Javascript Extjs未在网格中显示JSON数据
在存储中,我得到了JSON响应,但仍然无法在网格中加载数据 这是JavaScript代码:Javascript Extjs未在网格中显示JSON数据,javascript,json,extjs,grid,store,Javascript,Json,Extjs,Grid,Store,在存储中,我得到了JSON响应,但仍然无法在网格中加载数据 这是JavaScript代码: prepare: function(){ // The store this.store = new Ext.ux.app.data.Store({ directFn: Supplier.Hotelstock.Getcloseddate, fields: [ 'stock_days', 'stock_datefrom' ], auto
prepare: function(){
// The store
this.store = new Ext.ux.app.data.Store({
directFn: Supplier.Hotelstock.Getcloseddate,
fields: [ 'stock_days', 'stock_datefrom' ],
autoLoad: false
});
var filters = {};
var allowedFilters = ['supplier_id'];
for(var i=0; i<allowedFilters.length; i++){
if (!Ext.isEmpty(this[allowedFilters[i]])){
filters[allowedFilters[i]] = this[allowedFilters[i]];
}
}
this.store.setBaseParam('filter', filters);
this.store.load();
//alert(this.store.data.first());
// The grid
this.grid = new Ext.ux.app.page.Grid({
store: this.store,
border: false,
autoResizeColumn: 1,
region: 'center',
columns: [
{
dataIndex: 'stock_days',
header: 'Days',
width: 40
},
{
dataIndex: 'stock_datefrom',
header: 'Closed Date',
width: 200,
sortable: true
}
]
});
this.setItems([this.grid]);
}
您不会在数据中加载以下内容:
Ext.create('Ext.data.Store', {...
?
你把商店的参数放在哪里?我使用带有代理类型内存的存储,我在加载数据时也遇到同样的问题。如果您想对存储区使用的方法进行完整调用,请查看Sencha文档
Ext.create('Ext.data.Store', {...