Extjs: Struts2整合Extjs Grid时无法显示数据

shuaiyz shuaiyz 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
问题描述:在Action中获取list,从配置文件上合成json,可页面上的grid显示不出来数据。急急!!在线等!!

<script>
Ext.onReady(function(){
//定义store
var ds=new Ext.data.Store({
proxy:new Ext.data.HttpProxy({url:'tml/tml.action',method:'post'}),
reader:new Ext.data.JsonReader({
totalProperty:"total",
root:'list'
},
[
{name:'terminal_uid',mapping:'terminal_uid',type:'int'},
{name:'terminal_id',mapping:'terminal_id',type:'string'},
{name:'terminal_type',mapping:'terminal_type',type:'string'},
{name:'is_controllable',mapping:'is_controllable',type:'char'},
{name:'is_shuttable',mapping:'is_shuttable',type:'char'},
{name:'is_readdable',mapping:'is_readdable',type:'char'},
{name:'charge_person',mapping:'charge_person',type:'string'},
{name:'active_time',mapping:'active_time',type:'date'},
{name:'is_active',mapping:'is_active',type:'char'}
])
});
ds.load();
var sm =new Ext.grid.CheckboxSelectionModel(); //CheckBox选择列
var colM=new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),//行号列
sm,
{header:"终端ID",dataIndex:"terminal_uid",align:'center',sortable:true},
{header:"终端编号",dataIndex:"terminal_id",align:'center',sortable:true},
{header:"终端类型",dataIndex:"terminal_type",align:'center',sortable:true},
{header:"是否可控制",dataIndex:"is_controllable",align:'center',sortable:true},
{header:"是否可跳闸",dataIndex:"is_shuttable",align:'center',sortable:true},
{header:"是否可读表",dataIndex:"is_readdable",align:'center',sortable:true},
{header:"负责人",dataIndex:"charge_person",align:'center',sortable:true},
{header:"投运日期",dataIndex:"active_time",align:'center',
renderer:Ext.util.Format.dateRenderer('Y年m月d日'),editor:new Ext.form.DateField({format:'Y年m月d日'})},
{header:"是否有效",dataIndex:"is_active",align:'center',sortable:true}
]);
var grid=new Ext.grid.GridPanel({
renderTo:"hello",
title:"终端信息列表",
height:400,
width:1000,
cm:colM,
ds:ds,
sm:sm,
tbar:({
title:'工具栏',
items:[{xtype:'tbseparator'},{pressed:true,xtype:'button',text:'添加'},
{xtype:'tbseparator'},{pressed:true,xtype:'button',text:'删除'},
{xtype:'tbseparator'},{pressed:true,xtype:'button',text:'修改'}]
}),
autoExpandColumn:2
});
grid.render();
});
</script>
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
shuaiyz
Ajax 52,778 成员 25,334 内容