对于网上EXT的学习,大多提到json数据的接受问题,但是很少说到json数据中其他属性的得到:如下,
如题,请问我如何得到JsonReader的totalProperty属性值
部分源码如下
this.topPanel = new Ext.FormPanel({
id: "topPanel",
region: 'north',
height: 100,
width: 500,
layout: 'column',
frame: true,
border: false,
reader: new Ext.data.JsonReader({ root: 'date', totalProperty: 'totalPageCount' },
[{ name: 'au_fname', mapping: 'fname', type: 'string' },
{ name: 'au_lname', mapping: 'lname', type: 'string' }
]),
---------------------------------------------------------
我想得到reader里的totalProperty的属性,以便我自己分页用。谢谢
部分源码如下
this.topPanel = new Ext.FormPanel({
id: "topPanel",
region: 'north',
height: 100,
width: 500,
layout: 'column',
frame: true,
border: false,
reader: new Ext.data.JsonReader({ root: 'date', totalProperty: 'totalPageCount' },
[{ name: 'au_fname', mapping: 'fname', type: 'string' },
{ name: 'au_lname', mapping: 'lname', type: 'string' }
]),
---------------------------------------------------------
我想得到reader里的totalProperty的属性,以便我自己分页用。谢谢
回答:Ext.getCmp('topPanel').reader.meta.totalProperty
另外你要是获得不到,请注意你要确保数据已经加载,之后加载之后才能获得数据啊,也就是放到ds.on函数之下,你可以见我的另外一篇文章《
怎样获得JSON语句中的属性值》--http://easonfans.iteye.com/blog/450193。