在我的 Sencha 触摸应用程序中,我通过从 json 对象动态创建表单项来填充我的容器。
对于文本字段,我使用如下代码:
Ext.getCmp('mytestpanel').add({
xtype: response.screens[index].screenItems[i].xtype,
id:response.screens[index].screenItems[i].name,
label: response.screens[index].screenItems[i].title,
name: response.screens[index].screenItems[i].name
}
});
使用的json:
{
"screens": [
{
"screenname": "Screen 1",
"screenItems": [
{"xtype": "textfield", "title": "Temperature"," name": "textfield1", "value":"service211"},
{"xtype": "button", "title": "Update", "name": "button1"}
]
},
{
"screenname": "Screen 2",
"screenItems": [
{"xtype": "emailfield", "title": "screen2"," name": "textfield2"},
{"xtype": "checkboxfield", "title": "label3", "name": "textfield13"},
{"xtype": "selectfield", "title": "Submit", "name": "button11"}
]
}
]
}
我需要使用 json 中所见的 web 服务来更新此文本字段的值
{“xtype”:“textfield”,“title”:“Temperature”,“name”:“textfield1”,“value”:“someservice211” }
由于这些值将是实时的,我应该怎么做?