日期:2014-05-17 浏览次数:20670 次
ServletActionContext.getResponse().setCharacterEncoding("utf-8"); PrintWriter out = ServletActionContext.getResponse().getWriter(); //out.print(jsonString.toString()); out.write(jsonString.toString());
backReasonManage = function() { var pageSize = 20; var reader = new Ext.data.JsonReader({ root : 'dataList', totalProperty : 'total', id : 'id' }, [{name : 'id',mapping : 'id'}, {name : 'backResult',mapping : 'backResult'} ]); var store = new Ext.data.Store({ url : 'getAllBackReasonMessage.action', reader : reader }); store.load({ params : { start : 0, limit : pageSize } }); store.on('load',function(store){ alert(store.getTotalCount()); }); // store.on('loadexception', function() { //// store.removeAll(); //// bar.bind(store); // Ext.Msg.alert('查询', '数据加载错误!请重试'); // }); var colModel = new Ext.grid.ColumnModel([{ header : '序号', whdth : 100, sortable : true, dataIndex : 'id' },{ header : '退回原因', width : 100, sortable : true, dataIndex : 'backResult' }]); colModel.defaultSortable = true; var dataGrid = new Ext.grid.GridPanel({ store : store, region : 'center', cm : colModel, stripeRows : true, viewConfig : { forceFit : true }, sm : new Ext.grid.RowSelectionModel({ singleSelect : true }), trackMouseOver : false, loadMask : { msg : '正在加载数据,请稍侯……' } //title : 'User Information List', // bbar : bar }); var queryPanel = new Ext.Panel({ title : "", layout : 'border', width : 800, height : 600, frame : true, border : true, buttonAlign : 'right', items : [dataGrid], buttons : [{ text : '新增', handler : function() { }, { text : '修改', handler : function() { } ] }); // 刷新 function refreshGrid() { dataGrid.getStore().reload(); }; }; Ext.extend(backReasonManage, Ext.Panel); Ext.onReady(backReasonManage);
var reader = new Ext.data.JsonReader({ root : 'dataList', totalProperty : 'total', id : 'id' }, [{name : 'id',mapping : 'id'}, {name : 'backResult',mapping : 'backResult'} ]);
---