0
如果選擇了3個組合框,我有一個搜索,選定的valueid通過$ POST發送,然後通過AJAX發送給PHP。如何把JSON放入EXTJS Grid?
PHP從combobox id的一個mysql查詢構建並將其作爲JSON發回。 (JSON驗證)
但我的網格沒有填充!我如何把id數據過濾到我的網格中?
我的按鈕
buttons:[
{
text:'Search',
loadingText:'lädt',
handler:function() {
var form = Ext.getCmp('searchPanel').getForm();
form.submit(
{url: 'php/search.php'}
)
MY驗證JSON
"getRoutedata": [
{
"RouteID": "3",
"Loadingpoint": "Hafencity",
"Postalcode": "20457",
"Containercity": "Uhlenhorst",
"Carrier": "Bre SO",
"Transportmodel": "Truck",
"Containersize": "40",
"Containertype": "Horizontal",
"Harbor": "Antwerpen",
"Price": "1000.00",
"Year": "2012",
"Misc": "test"
}
]
我的商店
storePPT = new Ext.data.JsonStore({
url:'php/search.php',
storeId:'myStore',
root:'getRoutedata',
stateful:true,
idProperty:'RouteID',
fields:[
{name:'Carrier', type:'string', mapping:'Carrier'},
{name:'Containercity', type:'string', mapping:'Containercity'},
{name:'Containersize', type:'string', mapping:'Containersize'},
{name:'Containertype', type:'string', mapping:'Containertype'},
{name:'Harbor', type:'string', mapping:'Harbor'},
{name:'Loadingpoint', type:'string', mapping:'Loadingpoint'},
{name:'Misc', type:'string', mapping:'Misc'},
{name:'Postalcode', type:'string', mapping:'Postalcode'},
{name:'Price', type:'decimal', mapping:'Price'},
{name:'Transportmodel', type:'string', mapping:'Transportmodel'},
{name:'Year', type:'year', mapping:'Year'},
{name:'RouteID', type:'int', mapping:'RouteID'}
]
});
非常感謝您的幫助!
您好,感謝您的幫助,它並不能幫助..我有一個店,但JSON必須首先loadet進店,因爲沒有組合框的ID,在結果是空= :(我必須按下按鈕,然後json傳入商店,如何? – 2012-04-27 09:01:41