87,910
社区成员
发帖
与我相关
我的任务
分享
var Cols = [{ 'header': 'Item No', 'dataIndex': 'itemno', 'width': 80, sortable: false },
{ 'header': 'Qty', 'dataIndex': 'qty', 'width': 80 },
{ 'header': 'Length', 'dataIndex': 'leng', 'width': 80 },
{ dataIndex: 'pgmname', header: 'Material', width: 110, align: 'center' },
{ 'header': 'Color', 'dataIndex': 'colorname', 'width': 150 },
{ 'header': 'Specification', 'dataIndex': 'specdesc', 'width': 280 }
];
var queryParams = { configtype: "getlist"} ;
var DS = Ext.create('Ext.data.JsonStore', {
proxy: {
type: 'ajax',
actionMethods: { read: "POST" },
extraParams: queryParams,
url: 'OrderPartOps.ashx'
},
reader: {
type: 'json',
root: 'rows',
totalProperty: 'total'
},
fields: [
{ name: 'itemno', type: 'int' },
{ name: 'qty' },
{ name: 'leng', type: 'int' },
{ name: 'uprice', type: 'float' },
{ name: 'pgmname' },
{ name: 'colorname' },
{ name: 'userid' },
{ name: 'sessionid' },
{ name: 'orderno' },
{ name: 'needreview' },
{ name: 'specdesc' }
],
listeners: { load: function(store, records, success, opts) {
alert(store.data.getCount());//这里结果为“1”
},
autoLoad: true
}
});
Ext.create("Ext.grid.Panel", {
id: 'configGrid1',
title: 'Shutters',
store: DS,
columns: Cols,
displayInfo: true,
emptyMsg: "no data",
sortableColumns: false,
renderTo: 'dtdetail'
});
DS.load();