【发布时间】:2011-10-31 17:35:57
【问题描述】:
我可以使用dijit.form.FilteringSelect 来显示下拉框。但它会立即从商店dojo.data.ItemFileReadStore 请求我不想要的所有数据。我希望它使用文本框的当前值查询商店并显示自动完成器选项。
【问题讨论】:
标签: javascript autocomplete dojo
我可以使用dijit.form.FilteringSelect 来显示下拉框。但它会立即从商店dojo.data.ItemFileReadStore 请求我不想要的所有数据。我希望它使用文本框的当前值查询商店并显示自动完成器选项。
【问题讨论】:
标签: javascript autocomplete dojo
上面的一个更完整的例子,但等于有效。但就我而言,我使用QueryReadStore
this.store = new dojox.data.QueryReadStore({
url: 'url',
sortFields : [{attribute: 'attribute', descending: true}],
requestMethod : "get"}
);
callSuggest : function(){
var fetch = {
query: {attribute: "*"},
queryOptions: {
ignoreCase: true,
deep: true
},
serverQuery: this.searchParam,
onComplete: dojo.hitch(this, function(result, dataObject){
//do something
}),
onError: function(errText){
console.error('error');
}
};
this.store.fetch(fetch);
},
【讨论】:
我假设你必须执行类似的操作,
itemStore .fetch({ query: { name: "pepper", aisle: "Spices" },
queryOptions: { ignoreCase: true }, onComplete: ... });
请查看此链接以获取完整列表和详细信息。 http://dojotoolkit.org/reference-guide/quickstart/data/usingdatastores/filteringitems.html
【讨论】: