2011-10-31 81 views
3

我可以使用dijit.form.FilteringSelect來顯示下拉框。但它立刻請求我不想要的商店dojo.data.ItemFileReadStore的所有數據。我希望它使用文本框的當前值查詢商店並顯示Autocompleter選項。dojo自動完成

回答

0

你將不得不進行這樣的事情我認爲,

itemStore .fetch({查詢:{名稱: 「辣椒」,過道: 「香料」},
queryOptions:{IGNORECASE :true},onComplete:...});

請參閱此鏈接瞭解完整的清單和詳細信息。 http://dojotoolkit.org/reference-guide/quickstart/data/usingdatastores/filteringitems.html

+0

沒有,仍然需要從商店下載的同時數據。它只是在商店的自定義查詢。從商店接收部分數據。 –

1

一個更完整的例子如上,但等於有效。但在我的情況下,我使用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); 
    },