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 dd "}, {"id ": 3,"fullName ":"ee ff "}, {"id ": 4,"fullName ":"gg hh "}]}});
불량, 사본 붙여 넣기 오류, 샘플 데이터를 수정하려고했습니다! – hazimdikenli