Code:
The function mess () {
Ext. Define (' User '{
The extend: 'Ext data. The Model',
Fields: [" xh jg_num ", ""," jg_mc "]
});
Var mystore=Ext create (' Ext. Data. Store ', {
Model: 'User',
Proxy: {
Type: 'ajax,
Url: '/js/yd_sf. Json,
Reader: {
Type: 'json,
Model: 'User',
Root: 'RECORDS'
}
},
AotoLoad: true
});
Var grid=new Ext grid. GridPanel ({
Title: "the GRid form test,"
Width: 800,
Height: 300,
Store: mystore,
ColumnLine: true,
RenderTo: Ext getBody (),
The columns: [{
Header: "serial number", dadaIndex: xh},
{the header: "institutions", dataIndex: "jg_num"},
{the header: "name", dataIndex: "jg_mc", width: 300},
//height: 200,
Tbar: [
{xtype: 'textfield, name: "name"},
{text: 'query', name:} 'select', '-'
{the text: 'new', name: 'add'},
{the text: "closed", width: 80}
]
});
};
Ext onReady (function () {
Mess ();
});
=========================================
The corresponding json file format for:
{
"RECORDS:" [
{
"Xh" : 1,
"Jg_num" : "175695855",
"Jg_mc" : "comprehensive investment zone,"
"Server_num" : "9371337507177",
"Je" : 3990.00
},
{
"Xh" : 2,
"Jg_num" : "175695856",
"Jg_mc" : "west ring comprehensive industry,"
"Server_num" : "903713719795",
"Je" : 3733.00
},
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- & gt; Don't stick on more came up, the above is one of the two
Thank you very much!
CodePudding user response:
AotoLoad: true=====& gt;
AutoLoad: true
Did you release? Don't wait for its core with chrome browser, no allow access to a local file, but did not release sites don't use url: '/ js/yd_sf json ',
The path to relative path.. And/or js/XXX. Json to locate the path
Release site check server adds json file mime mapping: no, no is 404, does not support json file, such as iis 6 to the json files is not supported by default, the need to add 4 mime
CodePudding user response: