extjs ajax从后台取一条数据,在gird中显示问题 extjs ajax从后台取一条数据,这条数据是几条数据的累加,我怎么样才能够让这条数据显示在gird上呢?请高手帮忙,不胜感激。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 定义store,fields,最基本的ext内容,自己研究下api里的例子就是了 var store = Ext.create('Ext.data.JsonStore', { storeId: 'simpsonsStore', pageSize: itemsPerPage, autoLoad: false, remoteSort: false, fields: ['Id', 'MaterialTypeId', 'UnitId', 'MaterialCode', 'MaterialName', 'ABCType', 'MtName', 'Spell', 'Price', 'PackType', 'ModelNumber', 'Standard', 'UnitName', 'MaterialQuality', 'DrawingNo', 'Status', 'MaxStorage', 'MinStorage', 'MNDesc', 'PackSize', 'PalletPackages', 'Re', 'SafeStorage', 'StandardDesc'], proxy: { type: 'ajax', url: '<%= Url.Action("Search", "Material")%>', reader: { type: 'json', root: 'rows', totalProperty: 'totalCount' } } }); store.load({ params: { start: 0, limit: itemsPerPage } }); var selModel = Ext.create('Ext.selection.CheckboxModel', { checkOnly: false }); var bbar = new Ext.PagingToolbar({ pageSize: itemsPerPage, store: store, displayInfo: true }); //创建 Grid var grid = Ext.create('Ext.grid.Panel', { store: store, stripeRows: true, selModel: selModel, autoHeight: true, loadMask: true, columns: [ { dataIndex: 'Id', hidden: true, sortable: true, width: 80 }, { dataIndex: 'MaterialTypeId', hidden: true, sortable: true, width: 80 }, { dataIndex: 'UnitId', hidden: true, sortable: true, width: 80 }, { header: '物资编码', sortable: true, dataIndex: 'MaterialCode', width: 100 }, { header: '物资名称', sortable: true, dataIndex: 'MaterialName', width: 100 }, { header: '拼音编码', sortable: true, dataIndex: 'Spell', width: 100 }, { header: 'ABC物资分类', sortable: true, dataIndex: 'ABCType', width: 100 }, { header: '物资类型', sortable: true, dataIndex: 'MtName', width: 100 }, { header: '价格', sortable: true, dataIndex: 'Price', width: 100 }, { header: '型号', sortable: true, dataIndex: 'ModelNumber', width: 100 }, { header: '状态', sortable: true, dataIndex: 'Status', width: 100 }, { header: '备注', sortable: true, dataIndex: 'Re', width: 100 } ], region: 'center' }); { "totalCount": 2, "rows": [ { "Id": 3, "MtCode": "002", "MtName": "物资小类", "TypeName": "物资小类", "Sort": 1, "Re": "type desc小类型", "ParentTypeId": 1, "ParentTypeName": "所有类型" }, { "Id": 2, "MtCode": "001", "MtName": "物资大类", "TypeName": "物资大类", "Sort": 1, "Re": "type desc", "ParentTypeId": 1, "ParentTypeName": "所有类型" } ]} JS代码求解释 只有5行 谁能教我个时间判断的JS 寻网页浮动工具条jQuery实现方法或插件 用正则抽取特定数据 →XHTML中的scrollTop问题 请问这里%是什么意思 JS中没有大于32位的整数类型吗? 如何在客户端用JS缩放图片? 参数的传递 客户端脚本(javascript)如何读客户端主机上的注册表信息 请教JQuery实现元素互换方法? 下拉框背景图该如何实现
var store = Ext.create('Ext.data.JsonStore', {
storeId: 'simpsonsStore',
pageSize: itemsPerPage,
autoLoad: false,
remoteSort: false,
fields: ['Id', 'MaterialTypeId', 'UnitId', 'MaterialCode', 'MaterialName', 'ABCType', 'MtName', 'Spell', 'Price', 'PackType', 'ModelNumber', 'Standard', 'UnitName', 'MaterialQuality', 'DrawingNo', 'Status', 'MaxStorage', 'MinStorage', 'MNDesc', 'PackSize', 'PalletPackages', 'Re', 'SafeStorage', 'StandardDesc'],
proxy: {
type: 'ajax',
url: '<%= Url.Action("Search", "Material")%>',
reader: {
type: 'json',
root: 'rows',
totalProperty: 'totalCount'
}
}
}); store.load({
params: {
start: 0,
limit: itemsPerPage
}
}); var selModel = Ext.create('Ext.selection.CheckboxModel', { checkOnly: false }); var bbar = new Ext.PagingToolbar({
pageSize: itemsPerPage,
store: store,
displayInfo: true
}); //创建 Grid
var grid = Ext.create('Ext.grid.Panel', {
store: store,
stripeRows: true,
selModel: selModel,
autoHeight: true,
loadMask: true,
columns: [
{ dataIndex: 'Id', hidden: true, sortable: true, width: 80 },
{ dataIndex: 'MaterialTypeId', hidden: true, sortable: true, width: 80 },
{ dataIndex: 'UnitId', hidden: true, sortable: true, width: 80 },
{ header: '物资编码', sortable: true, dataIndex: 'MaterialCode', width: 100 },
{ header: '物资名称', sortable: true, dataIndex: 'MaterialName', width: 100 },
{ header: '拼音编码', sortable: true, dataIndex: 'Spell', width: 100 },
{ header: 'ABC物资分类', sortable: true, dataIndex: 'ABCType', width: 100 },
{ header: '物资类型', sortable: true, dataIndex: 'MtName', width: 100 },
{ header: '价格', sortable: true, dataIndex: 'Price', width: 100 },
{ header: '型号', sortable: true, dataIndex: 'ModelNumber', width: 100 },
{ header: '状态', sortable: true, dataIndex: 'Status', width: 100 },
{ header: '备注', sortable: true, dataIndex: 'Re', width: 100 }
],
region: 'center'
});
{
"totalCount": 2,
"rows": [
{
"Id": 3,
"MtCode": "002",
"MtName": "物资小类",
"TypeName": "物资小类",
"Sort": 1,
"Re": "type desc小类型",
"ParentTypeId": 1,
"ParentTypeName": "所有类型"
},
{
"Id": 2,
"MtCode": "001",
"MtName": "物资大类",
"TypeName": "物资大类",
"Sort": 1,
"Re": "type desc",
"ParentTypeId": 1,
"ParentTypeName": "所有类型"
}
]
}