|
本帖最后由 qweasdzxc 于 2017-8-21 10:44 编辑
现在想做个搜索框能输入值500毫秒后自动搜索的功能,搜索框代码html、js如下,现在什么事件能控制到我输入框的值在一直改变着,从而实现500好秒后自动搜索,不是bind-change事件,bind-change事件要焦点移出,想要的是焦点在框里就能触发的
像smartFilter组件那样的效果,但是我的是cData,自己拼条件去后台查,所以只能自己写
- ,<div xid="div1" style="background-color:white;" class="x-search">
- <div class="x-query-input x-flex" xid="div2" style="height:100%;">
- <i class="icon-android-search x-icon-lg" xid="i3"/>
- <input type="text" class="x-flex1" xid="input1" placeHolder="搜索"
- data-bind="value:filterText,valueUpdate: 'input'" bind-change="input1Change"/>
- <i class="icon-close-circled x-icon-lg x-cls-filter" bind-css="{hide:!filterText.get()}"
- bind-click="clsfilterText"/>
- </div>
- </div>
复制代码- var Model = function(){
- this.callParent();
- statusCode="0";
- this.filterText = justep.Bind.observable("");
- self=this;
- };
复制代码
|
|