Listview 钛appcelerator搜索不适用于搜索栏
我有以下代码:Listview 钛appcelerator搜索不适用于搜索栏,listview,appcelerator,appcelerator-titanium,searchbar,Listview,Appcelerator,Appcelerator Titanium,Searchbar,我有以下代码: var search=tianium.UI.createSearchBar(); var myTemplate={ 特性:{ 附件类型:Ti.UI.LIST\u附件类型\u披露, }, 子模板:[ { 键入:“Ti.UI.Label”, bindId:“destinazione”, 特性:{ 左:“24%” } }, ] }; var listView=Ti.UI.createListView({ 模板:{'template
var search=tianium.UI.createSearchBar();
var myTemplate={
特性:{
附件类型:Ti.UI.LIST\u附件类型\u披露,
},
子模板:[
{
键入:“Ti.UI.Label”,
bindId:“destinazione”,
特性:{
左:“24%”
}
},
]
};
var listView=Ti.UI.createListView({
模板:{'template':myTemplate},
defaultItemTemplate:“模板”,
搜索视图:搜索
});
用onload恢复要输入的数据后
xhrPart.onload=function(){
partenzeJSON=JSON.parse(this.responseText);
对于(我在partenzeJSON){
var flightSection=Ti.UI.createListSection();
var flightDataSet=[];
flightDataSet=[{
destinazione:{text:partenzeJSON[i]。destinazione,可搜索文本:partenzeJSON[i]。destinazione},
}];
flightSection.setItems(flightDataSet);
部分。推送(飞行部分);
}
listViewPartenze.setSections(节);
};
因为研究不起作用?
不在listview中查找输入的数据
谢谢
可搜索文本
必须进入对象的属性,而不是标签
应该是这样的:
flightDataSet = [{
destinazione: {text: partenzeJSON[i].destinazione},
properties: {searchableText: partenzeJSON[i].destinazione}
}];
searchableText
必须进入对象的属性,而不是标签
应该是这样的:
flightDataSet = [{
destinazione: {text: partenzeJSON[i].destinazione},
properties: {searchableText: partenzeJSON[i].destinazione}
}];