var remoteLookupJsonStore = new Ext.data.JsonStore({
root : 'records',
baseParams : {
column : 'fullName'
},
fields : [
{
name : 'name',
mapping : 'fullName'
},
{
name : 'id',
mapping : 'id'
}
],
proxy : new Ext.data.ScriptTagProxy({
url : 'LookupLoader.ashx'
//url: 'http://tdg-i.com/dataQuery.php' similar data
})
});
var combo2 = {
xtype : 'combo',
fieldLabel : 'Search by name',
forceSelection : true,
displayField : 'name',
valueField : 'id',
hiddenName : 'customerId',
loadingText : 'Querying....',
minChars : 1,
triggerAction : 'name',
store : remoteLookupJsonStore
};
此示例使用原始數據存儲「http://tdg-i.com/dataQuery.php」。我的ashx處理程序以相同的格式返回數據,但數據不同。無論如何,當我使用我的ashx處理程序時,處理程序會被調用,它會返回數據,但組合總是處於加載狀態,並且從不顯示數據。 我假設問題出在我回來的數據上,但它的格式沒問題,我改變的最後一件事是設置內容類型ExtJS combobox jsonDataStore
context.Response.ContentType =「application/json」;
但我仍然無法得到這個東西的工作,有什麼建議嗎?
這是來自我的處理程序的數據。 ({「totalCount」:「4」,「records」:[{「id」:1,「fullName」:「aaa bbb」},{「id」:2,「fullName」:'cc ddd 「},{」id「:3,」fullName「:」ee ff「},{」id「:4,」fullName「:」gg hh「}]});
我的不好,其複製粘貼錯誤,我試圖修改樣本數據! – hazimdikenli 2009-09-23 14:17:38