extjs得到数据页面不显示 10
Ext.onReady(function(){//初始化ExtjsExt.QuickTips.init();Ext.BLANK_IMAGE_URL='webapps-mo...
Ext.onReady(function(){
//初始化Extjs
Ext.QuickTips.init();
Ext.BLANK_IMAGE_URL='webapps-modules/webapp-jxushop/js/s.gif';
//读取数据,Json格式
var ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'listshop.action'}),
reader: new Ext.data.JsonReader(
{root: 'listshop'},
Ext.data.Record.create([
{name:'accountdate',type:'date'},
{name:'cashboxtotal',type:'double'},
{name:'dayrealitymoney',type:'double'},
{name:'deposit',type:'double'},
{name:'groupontotal',type:'double'},
{name:'id',type:'int'},
{name:'market',type:'int'},
{name:'procurementtotal',type:'double'},
{name:'salestotal',type:'double'},
{name:'salestotalroll',type:'double'}
])
)
});
//数据加载
ds.reload(true);
//定义GridPanel的列名称
var cm=new Ext.grid.ColumnModel([
//header列名称,dateIndex对应数据库字段名称,sortable支持排序
{header:"编号",dateIndex:"id"},
{header:"报账时间",dateIndex:"accountdate"},
{header:"店铺选择",dateIndex:"market"},
{header:"采购支出",dateIndex:"procurementtotal"},
{header:"团购总计",dateIndex:"groupontotal"},
{header:"日钱箱总计",dateIndex:"cashboxtotal"},
{header:"日备用金",dateIndex:"deposit"},
{header:"日销售总计含(团)",dateIndex:"salestotalroll"},
{header:"日销售总计不含(团)",dateIndex:"salestotal"},
{header:"实收资金",dateIndex:"dayrealitymoney"}
]);
var grid = new Ext.grid.GridPanel({
el: 'grid',
ds:ds,
cm:cm,
title:'当前位置:店铺管理报账记录>店铺报账记录',
autoWidth:true,
autoHeight:true
});
grid.render();
});
</script> 展开
//初始化Extjs
Ext.QuickTips.init();
Ext.BLANK_IMAGE_URL='webapps-modules/webapp-jxushop/js/s.gif';
//读取数据,Json格式
var ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'listshop.action'}),
reader: new Ext.data.JsonReader(
{root: 'listshop'},
Ext.data.Record.create([
{name:'accountdate',type:'date'},
{name:'cashboxtotal',type:'double'},
{name:'dayrealitymoney',type:'double'},
{name:'deposit',type:'double'},
{name:'groupontotal',type:'double'},
{name:'id',type:'int'},
{name:'market',type:'int'},
{name:'procurementtotal',type:'double'},
{name:'salestotal',type:'double'},
{name:'salestotalroll',type:'double'}
])
)
});
//数据加载
ds.reload(true);
//定义GridPanel的列名称
var cm=new Ext.grid.ColumnModel([
//header列名称,dateIndex对应数据库字段名称,sortable支持排序
{header:"编号",dateIndex:"id"},
{header:"报账时间",dateIndex:"accountdate"},
{header:"店铺选择",dateIndex:"market"},
{header:"采购支出",dateIndex:"procurementtotal"},
{header:"团购总计",dateIndex:"groupontotal"},
{header:"日钱箱总计",dateIndex:"cashboxtotal"},
{header:"日备用金",dateIndex:"deposit"},
{header:"日销售总计含(团)",dateIndex:"salestotalroll"},
{header:"日销售总计不含(团)",dateIndex:"salestotal"},
{header:"实收资金",dateIndex:"dayrealitymoney"}
]);
var grid = new Ext.grid.GridPanel({
el: 'grid',
ds:ds,
cm:cm,
title:'当前位置:店铺管理报账记录>店铺报账记录',
autoWidth:true,
autoHeight:true
});
grid.render();
});
</script> 展开
1个回答
2014-04-10
展开全部
看你的后台是不是已经查到了数据,并且按照前台的dataIndex保存到JSON格式里面了。。。
追问
保存到json里面了,而且json的数据格式也正常。
追答
那你在后台输出一下看是不是把JSON格式的数据存到root里面了,我看到你这里的root为listshop
那就比如
JSONobject jo = new JSONobject();
jo.put("listshop",array);
然后再返回到前台。 array为JSONArray格式的保存你查询出来的数据
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询