87,923
社区成员
发帖
与我相关
我的任务
分享
var chargeElecStore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'getChangeElecDevice.action'}),//提交的页面
reader: new Ext.data.JsonReader({ root: "root"}, [
{name: 'deviceID',mapping:'deviceID',type:'string'},
{name: 'deviceNm',mapping:'deviceNm',type:'string'},
{name: 'deviceCode',mapping:'deviceCode',type:'string'}
])
});
chargeElecStore.load();
private JSONArray deviceList;
public JSONArray getDeviceList() {
return deviceList;
}
public void setDeviceList(JSONArray deviceList) {
this.deviceList = deviceList;
}
public String execute() throws Exception
{
List<ChargeElecDevice> deviceLst = deviceDao.getChangeDev();
JSONArray jsonArray = JSONArray.fromObject(deviceLst);
this.setDeviceList(jsonArray);
return SUCCESS;
}
<package name="evcs.action" extends="json-default">
<!--获取充电机-->
<action name="getChangeElecDevice" class="evcs.action.GetElecDeviceAction">
<result name="success" type="json">
<param name="root">deviceList</param>
</result>
<result name="error" type="json">
<param name="root">deviceList</param>
</result>
</action>
</package>
var chargeElecStore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'getChangeElecDevice.action'}),//提交的页面
reader: new Ext.data.JsonReader({ root: "root"})
, fields:[///////
{name: 'deviceID',mapping:'deviceID',type:'string'},
{name: 'deviceNm',mapping:'deviceNm',type:'string'},
{name: 'deviceCode',mapping:'deviceCode',type:'string'}
]///)
});
什么版本的ext?4+ 应该上面拿上配置store
protected Map deviceList;
public Map getDeviceList() {
return deviceList;
}
public void setDeviceList(Map deviceList) {
this.deviceList = deviceList;
}
public String execute() throws Exception
{
List devices = deviceDao.getChangeDev();
deviceList = new HashMap<String, Object>();
deviceList.put(”root“, deviceList );
return SUCCESS;
}
protected List deviceList= new ArrayList();
public List getDeviceList() {
return deviceList;
}
public void setDeviceList(List deviceList) {
this.deviceList = deviceList;
}
public String execute() throws Exception
{
deviceList = deviceDao.getChangeDev();
return SUCCESS;
}
protected List deviceList= new ArrayList();
public List getDeviceList() {
return deviceList;
}
public void setDeviceList(List deviceList) {
this.deviceList = deviceList;
}
public String execute() throws Exception
{
List deviceLst = deviceDao.getChangeDev();
return SUCCESS;
}