日期:2014-05-17 浏览次数:20628 次
function actionReadAllDep() { $pageLimit = getPageLimit(); $erp = new ModelErp(); $sql = "SELECT * FROM es_dep_pro"; $dep = $erp->getList($sql,$pageLimit['form'],$pageLimit['to']); $result['totalCount'] = count($dep); $result['topics'] = $dep; require(CFG_PATH_LIB.'util/JSON.php'); $json = new Services_JSON(); echo $json->encode($result); }
Ext.onReady(function(){ var ds = new Ext.data.Store({ proxy : new Ext.data.HttpProxy({url:'index.php?model=erp&action=ReadAllDep&'}), reader: new Ext.data.JsonReader({ root: 'topics', totalProperty: 'totalCount' },[ 'DEP_ID','DEP_NAME','UPPER_ID','STATUS' ]) }); var cm = new Ext.grid.ColumnModel([ {header:"部门编号",width:80,dataIndex:"DEP_ID"}, {header:"部门名称",width:100,dataIndex:"DEP_NAME"}, {header:"上级部门编号",width:80,dataIndex:"UPPER_ID"}, {header:"部门状态",width:30,dataIndex:"STATUS"} ]); cm.defaultSortable = true; /*var grid = new Ext.grid.GridPanel({ region:'center', loadMask:true, store:ds, cm:cm, stripeRows:true, border:true, borderStyle:'width:100', autoScroll:true });*/ ds.load({params: {start: 0,limit: 20}}); loadend(); });