我的代码如下: //内经
var com_volume = new Ext.data.Store({//配置分组数据集
autoLoad :true,
proxy:new Ext.data.HttpProxy({url:'jsp/GetVolumeData.jsp'}),
reader:new Ext.data.JsonReader({
totalProperty:'total',
root:'stocks'
},
[
{name: 'id'},
{name: 'volume1'},
{name: 'code'}
]),
failure : function() {
Ext.Msg.alert("数据加载失败!请检查");
}
});combo cls : 'key',
xtype:'combo',
fieldLabel: '内外卷',
// width : 150,
allowBlank : true,
blankText : '请填写内外卷',
readOnly : true,
id : 'volume',
name : 'volume',
emptyText:'请填写内外卷',
triggeraction : 'all',
store : com_volume,
diaplayField : 'volume1',
valueField : 'volume1',
mode : 'local',
// format:'Y-m-d',
anchor:'90%'
我的JSON数据没问题,怎么取不出值来啊?请帮看看,谢谢!
var com_volume = new Ext.data.Store({//配置分组数据集
autoLoad :true,
proxy:new Ext.data.HttpProxy({url:'jsp/GetVolumeData.jsp'}),
reader:new Ext.data.JsonReader({
totalProperty:'total',
root:'stocks'
},
[
{name: 'id'},
{name: 'volume1'},
{name: 'code'}
]),
failure : function() {
Ext.Msg.alert("数据加载失败!请检查");
}
});combo cls : 'key',
xtype:'combo',
fieldLabel: '内外卷',
// width : 150,
allowBlank : true,
blankText : '请填写内外卷',
readOnly : true,
id : 'volume',
name : 'volume',
emptyText:'请填写内外卷',
triggeraction : 'all',
store : com_volume,
diaplayField : 'volume1',
valueField : 'volume1',
mode : 'local',
// format:'Y-m-d',
anchor:'90%'
我的JSON数据没问题,怎么取不出值来啊?请帮看看,谢谢!
解决方案 »
- Hibernate 主键生成策略的选择
- 下面java代码运行后,为什么j的值会是0?已经循环99次了,无论如何也不能是0呀!想不明白,请教
- SSH项目错误
- web service是什么?
- 如何用ant 直接发布EAR 到 websphere 6中
- sqlserver中的float类型映射到hibernate的xml文件出错!!!求助!!!
- 请问高手jbuilder建立cmp?
- 又是一个struts问题!!!!
- 请问j2ee中自带的Application Server比weblogic有什么不同?是否能代替weblogic?
- jsp设计问题
- java是否有能替代JColorChooser的组件或其它替代方法,颜色板中的颜色条是阶梯状的
- 注册成功了但是登录不进去啊。请高手帮帮忙啊,
valueField : 'id',
String url = "jdbc:mysql://127.0.0.1/testorder?useUnicode=true&characterEncoding=utf-8";
String user = "root";
String psw = "123456";
Connection conn = DriverManager.getConnection(url,user,psw);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql="select * from volumeset";
ResultSet rs=stmt.executeQuery(sql);
int i=1;
String result=null;
String rowcount=null;
JSONObject jsonObject = new JSONObject();
while(rs.next()) {
jsonObject.put("id", (Object)rs.getString(1));
jsonObject.put("volume1", (Object)rs.getString(2));
jsonObject.put("code", (Object)rs.getString(3));
if (i==1)
{
result = jsonObject.toString();
}
else
{
result += "," + jsonObject.toString();
}
i++;
}
rs.close();
stmt.close();
conn.close();
rowcount=String.valueOf(i-1);
response.getWriter().write("{total:"+rowcount+",stocks:[" + result + "]}");
这是或的的数据{total:2,stocks:[{"code":"A","volume1":"大纸","id":"1"},{"code":"B","volume1":"小纸","id":"2"}]}
你传了三个变量,而combo 只需要两个
id : WhspSfhBusinessPojo.businessNature.id,
fieldLabel : "<font color=red>* </font>"+ WhspSfhBusinessPojo.businessNature.title,
anchor : "95%",
mode : "remote",
readOnly : true,
typeAhead : true,
triggerAction : "all",
disabled : fieldsfunc.businessNature.readonly,
valueField : WhspBizNatureParaPojo.natureId.id,
displayField : WhspBizNatureParaPojo.natureName.id,
selectOnFocus : true,
emptyText : "请选择...",
allowBlank : false,
store : new Ext.data.JsonStore( {
id : "businessNatureStore",
autoLoad : true,
url : ctxpath + '/whsp/bizNature.do?method=getAllBizNature',
root : 'data',
totalProperty: 'totalSize',
fields : [
{name:WhspBizNatureParaPojo.natureId.id},
{name:WhspBizNatureParaPojo.natureName.id}
]
})
});
应该能看懂吧,我觉得那个store应该写成Ext.data.JsonStore
id : WhspSfhBusinessPojo.businessNature.id,
fieldLabel : "<font color=red>* </font>"+ WhspSfhBusinessPojo.businessNature.title,
anchor : "95%",
mode : "remote",
readOnly : true,
typeAhead : true,
triggerAction : "all",
disabled : fieldsfunc.businessNature.readonly,
valueField : WhspBizNatureParaPojo.natureId.id,
displayField : WhspBizNatureParaPojo.natureName.id,
selectOnFocus : true,
emptyText : "请选择...",
allowBlank : false,
store : new Ext.data.JsonStore( {
id : "businessNatureStore",
autoLoad : true,
url : ctxpath + '/whsp/bizNature.do?method=getAllBizNature',
root : 'data',
totalProperty: 'totalSize',
fields : [
{name:WhspBizNatureParaPojo.natureId.id},
{name:WhspBizNatureParaPojo.natureName.id}
]
})
});
response.getWriter().close();