Extjs Ext.data.Store使用问题
大家好,我最近在使用Extjs模板,遇到个问题,想请教大家,我在用Ext.data.Store读取服务器的数据,在前台显示的时候显示不出东西来,这是怎么回事。
以下是我的后台代码:
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->
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);
}
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->
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();
});
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号