//gridP gridpanel id Ext.apply(Ext.getCmp("gridP").store.baseParams, { 参数1: 111, 参数2:222 });
grid = new Ext.grid.GridPanel({ frame: true, id: 'gridP', title: 'Order List', stripeRows: true, //斑马线 store: store, applyTo: 'view', //指定显示数据的div trackMouseOver: true, height: 700, window.screen.width - 17, //屏幕分辨率的宽 textfield tbar: [ { xtype: 'label', text: '选择日期' }, { xtype: 'datefield', id: 'txtBegin' }, { xtype: 'label', text: '---' }, { xtype: 'datefield', id: 'txtEnd' }, { xtype: 'button', text: 'Search', handler: function () { //提交数据 var begin = Ext.fly('txtBegin').dom.value; var end = Ext.fly('txtEnd').dom.value; document.getElementById('hdbegin').value = begin; document.getElementById('hdend').value = end; if (begin == "") return; if (end == "") return; store.proxy.conn.url = 'ExtData.aspx?type=3&p=' + Math.random(); //往store添加baseParams Ext.apply(Ext.getCmp("gridP").store.baseParams, { begin: begin, end: end }); store.load({ params: { start: 0, limit: 20, begin: begin, end: end } }) } } ], viewConfig: { forceFit: true, //让grid的列自动填满grid的整个宽度,不用一列一列的设定宽度。 emptyText: 'No Data' }, loadMask: { msg: 'loading……' }, columns: [ new Ext.grid.RowNumberer(), //行号 {header: '<font size=2>OrderID</font>', dataIndex: 'OrderID', sortable: true, align: "center" }, { header: '<font size=2>Sales Type</font>', dataIndex: 'State', sortable: true, align: "center", hidden: true, renderer: function (value) { if (value == "0") { return "pending"; } else if (value == "1") { return "processed"; } else { return "xxx"; } } }, { header: '<font size=2>SO</font>', dataIndex: 'SO', sortable: true, align: "center" }, { header: '<font size=2>PSI</font>', dataIndex: 'PSI', sortable: true, align: "center" }, { header: '<font size=2>Company</font>', dataIndex: 'Company', sortable: true, align: "center" }, { header: '<font size=2>Date</font>', dataIndex: 'Odate', sortable: true, align: "center" }, { header: '<font size=2>Email</font>', dataIndex: 'Email', sortable: true, align: "center" }, { header: '<font size=2>Payment</font>', dataIndex: 'Payment_Terms_Code', sortable: true, align: "center" }, { header: '<font size=2>Preorderid</font>', dataIndex: 'Preorderid', sortable: true, align: "center" }, { header: '<font size=2>Items</font>', dataIndex: 'Items', sortable: true, align: "center" } ], bbar: new Ext.PagingToolbar({//分页 pageSize: 20, store: store, displayInfo: true, //非要为true,不然不会显示下面的分页按钮 emptyMsg: "NO DATA" }) })