首页 新闻 会员 周边

ext怎样把json数据显示到表格上啊?

0
悬赏园豆:5 [待解决问题]
这个过程调了两天了,总是不能显示到表格上,下边是script代码,已经获取json格式数据,log4j可以将它显示出来,后边贴出
<script type="text/javascript"> Ext.onReady(function() { var record = Ext.data.Record.create([ { name : "pay_code", mapping : "pay_code", type : "string" },{ name : "pay_content", mapping : "pay_content", type : "string" }, { name : "pay_date", mapping : "pay_date", type : "string" },{ name : "pay_id", mapping : "pay_id", type : "int" },{ name : "pay_money", mapping : "pay_money", type:"string" }, { name : "pay_person", mapping : "pay_person", type : "string" }]); var reader = new Ext.data.JsonReader({ totalProperty : 'totalProperty', root : 'payList' }, record); var store = new Ext.data.Store({ proxy : new Ext.data.HttpProxy({ url : 'queryPayByDateForJson.action' }, { method : 'post' }), reader : reader, remoteSort : true }); //store.setDefaultSort('userId', 'DESC'); store.load();//搜索 var grid = new Ext.grid.GridPanel({ id : 'fee_Grid', name : 'fee_Grid', autoWidth : true, height : 300, loadMask : '正在查找', // cm:cmMol, columns : [ { header : '类型', sortable: true, dataIndex : 'pay_code', width : 100 }, { header : '备注', sortable: true, dataIndex : 'pay_content', width : 150 }, { header : '日期', sortable: true, dataIndex : 'pay_date', width : 150 }, { header : 'id', sortable: true, dataIndex : 'pay_id', width : 100 }, { header : '金额', sortable: true, dataIndex : 'pay_money', width : 300, }, { header : '人员', sortable: true, dataIndex : 'pay_person', width : 150 } ], store:store , renderTo:Ext.getBody() }); //Ext.Msg.alert(store.data[2]); // grid.render("show"); }); </script>

获取的json数据:

DEBUG JSONUtil:72 - [JSON][{"pay_code":"吃饭","pay_content":"","pay_date":"2014-01-12","pay_id":10,"pay_money":4.2,"pay_person":"zaj"}

总是显示成下边的空白

谢谢了,已经纠结我两天了,拜托各位大神

273度的主页 273度 | 初学一级 | 园豆:197
提问于:2014-01-13 11:17
< >
分享
所有回答(1)
0

看我的blog,上面有详细的介绍

幕三少 | 园豆:1384 (小虾三级) | 2014-01-13 17:25

谢谢你,但是我不是用的ajax,我现在已经把json取到了,只是想把他显示到ext的表格中,我觉得有必要从头好好学一下ext,很强大的样子,还有,博客的时钟很带感!

支持(0) 反对(0) 273度 | 园豆:197 (初学一级) | 2014-01-13 21:05
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册