Sapui5 实时搜索字段回写
我有一个带有liveChange属性的搜索字段:Sapui5 实时搜索字段回写,sapui5,Sapui5,我有一个带有liveChange属性的搜索字段: <SearchField id="searchField" liveChange="onSearch" width="100%" /> 但在我写的每个字符上,光标都返回al位置0。例如,如果我想搜索房子,我写了这个词,但我看到了ESUOH 如果我使用search而不是liveChange它就可以工作了 有一个解决方案。请设置搜索字段的属性:选择onfocus=“false” 请同时参阅 问候,, 艾伦我想你是在受其他事情的折磨。。。
<SearchField id="searchField" liveChange="onSearch" width="100%" />
但在我写的每个字符上,光标都返回al位置0。例如,如果我想搜索房子,我写了这个词,但我看到了ESUOH
如果我使用
search
而不是liveChange
它就可以工作了 有一个解决方案。请设置搜索字段的属性:选择onfocus=“false”
请同时参阅
问候,,
艾伦我想你是在受其他事情的折磨。。。
onSearch
方法中的代码并不表示有任何错误。您是否在其他地方将焦点设置为控件?使用您提供的代码查看此示例(我将部分注释到其他控件)
onSearch : function (oEvt) {
// add filter for search
var aFilters = [];
var sQuery = oEvt.getSource().getValue();
if (sQuery && sQuery.length > 0) {
var fileterCol=this.byId("selectSearch789").getSelectedKey();
var filter = new sap.ui.model.Filter(fileterCol, sap.ui.model.FilterOperator.Contains, sQuery);
aFilters.push(filter);
}
// update list binding
var tableArtConNom = this.getView().byId("tableResult");
var binding = tableArtConNom.getBinding("items");
binding.filter(aFilters, "Application");
}