这是一个 ExtJs 的 js 文件,通过数据库查询然后返回EditorGridPanel中
现在分页不管用,谁能帮我把代码写出来
非常感谢
var fds_jbxx4 = new Ext.data.Store();
var cm_jbxx4 = new Ext.grid.ColumnModel([
{header: "台区编号", width: 80, dataIndex: 'tgNo', sortable: true},
{header: "用户编号", width: 80, dataIndex: 'consNo', sortable: true},
{header: "原用户编号", width: 80, dataIndex: 'orgnConsNo', sortable: true},
{header: "用户名称", width: 80, dataIndex: 'consName', sortable: true},
{header: "用电地址", width: 80, dataIndex: 'elecAddr', sortable: true},
{header: "契约容量", width: 80, dataIndex: 'contractCap', sortable: true},
{header: "用电类型", width: 80, dataIndex: 'elecTypeCode', sortable: true},
{header: "受电电压", width: 80, dataIndex: 'voltCode', sortable: true},
{header: "表号", width: 80, dataIndex: 'madeNo', sortable: true},
{header: "缴费方式", width: 80, dataIndex: 'payMode', sortable: true},
{header: "抄表段", width: 80, dataIndex: 'mrSectNo', sortable: true}
]);
var sm_jbxx4 = new Ext.grid.RowSelectionModel();
var grid_jbxx4 = new Ext.grid.EditorGridPanel({
ds:fds_jbxx4,
cm:cm_jbxx4,
sm:sm_jbxx4,
width:1000,
height:200,
fit:true,
tbar:new Ext.PagingToolbar({
store: fds_jbxx4,
pageSize: 2,
displayInfo: true,
displayMsg: '第{0}条到{1}条,一共{2}条',
emptyMsg: '没有记录'
})
});
var tgNo;
var tab_jbxx4 = new Ext.form.FormPanel({
labelAlign: 'left',
title: '按台区查询用户信息',
bodyStyle:'padding:5px',
width: 600,
items: [
{
layout:'column',
border:false,
items:
[{
columnWidth:.5,
layout: 'form',
border:false,
items: [tgNo= new Ext.form.TextField({
fieldLabel: '台区编号',
name: 'tgNo',
anchor:'95%'})]
},
{
columnWidth:.5,
layout: 'form',
buttonAlign:'right',
border:false,
items:
[
{
xtype:'button',
text:'查询',
handler:getjbxx4
}
]
}]
},
{
layout:'column',
items:grid_jbxx4,
title:'查询详细信息'
}
]
});
// trigger the data store load
function getjbxx4()
{
var ds_jbxx4 = new Ext.data.Store({
autoLoad :{params:{start:0, limit:20 }},
reader: new Ext.data.JsonReader({
totalRecords : "results_jbxx4",
root : "items_jbxx4",
fields : [
{name: 'tgNo'},
{name: 'consNo'},
{name: 'orgnConsNo'},
{name: 'consName'},
{name: 'elecAddr'},
{name: 'contractCap'},
{name: 'elecTypeCode'},
{name: 'voltCode'},
{name: 'madeNo'},
{name: 'payMode'},
{name: 'mrSectNo'}
]
}),
baseParams : { 'tgNo': tgNo.getValue()},
proxy : new Ext.data.HttpProxy(
{
url : basePath+'tgAction.action'
})
});
ds_jbxx4.load();
grid_jbxx4.reconfigure(ds_jbxx4,cm_jbxx4);
};