在ext 3.4中,我通过JsonReader解析了后台传过来的json串,现在想在界面把‘pstnPhoneNum’和‘ftthPhoneNum’的值加到一起显示请问如何能在界面中拿到这两项的值做和,并在form的items中显示呢?代码如下:this._jsonFormReader = new Ext.data.JsonReader({
root : 'result',
totalProperty : 'totalSize',
id : 'addrId',
successProperty : 'success'
},[
{name:'addrId',mapping:'addrId'},
{name:'hostName',mapping:'hostName'},
{name:'pstnPhoneNum',mapping:'pstnPhoneNum'},
{name:'ftthPhoneNum',mapping:'ftthPhoneNum'}
]
);
this.form = new Ext.FormPanel({
labelWidth: 85,
labelAlign : 'right',
bodyStyle: 'padding:5px',
baseCls: 'x-plain',
reader:this._jsonFormReader,
scope:this,
autoScroll : true,
defaults: {width: 160},
items:[
{name:'addrId',xtype:'labelfield',fieldLabel:'标准地址编号',anchor:'-20'},
{name:'hostName',xtype:'labelfield',fieldLabel:'局站名称',anchor:'-20'},
// {name:'agDslNum',xtype:'labelfield',fieldLabel:'总和',anchor:'-20'}
]extformpanelJsonReader

解决方案 »

  1.   

    3.4的formpanel 没有 reader:this._jsonFormReader config啊
    你是想要后台请求一个数据下来,然后直接赋给form里面的textfield吧..
    自己找到指定的textfield然后直接赋值就好了
      

  2.   


    后台传的是json字串,我得先在界面解析,现在就不知道如何能在界面中去的解析的某一项的值,并在FromPanel的Window中显示出来
      

  3.   


    后台传的是json字串,我得先在界面解析,现在就不知道如何能在界面中去的解析的某一项的值,并在FromPanel的Window中显示出来
    jsonreader会自动去解析啊 FormPanel 直接load就可以了