首先说下我的业务,配上图案大家容易理解:
[table]
|点击下图修改按钮:|
[/table]
[img]http://dl.iteye.com/upload/attachment/446584/96315930-cfc5-39c5-90ca-3cf35918283f.png[/img]
[code="java"]function loadForm(ptid){
ProgramForm.getForm().load({
waitMsg : '正在加载数据请稍后', //提示信息
waitTitle : '提示', //标题
url : 'findTpartytype.action?tpartytype.id='+ptid, //请求的url地址
method:'POST', //请求方式
success:function(form,action){ //加载成功的处理函数
ProgramForm.load();
(action.result.data),
Ext.Msg.alert('提示','find成功');
},
failure:function(form,action){ //加载失败的处理函数
Ext.Msg.alert('提示','find失败');
}
});
}[/code]
[table]
|效果图如下:|
[/table]
[img]http://dl.iteye.com/upload/attachment/446582/2859bccb-2c98-34fd-8ca2-86c49d0421b9.png[/img]
FomrPanel代码如下:
[code="java"]var ProgramForm = new Ext.FormPanel({
labelSeparator : ":", //元素分隔符为:s
frame:true, //是否渲染
height:100,
border:true, //无边框
reader : new Ext.data.JsonReader({
field:'json',
root:'root'
// totalProperty:'totalCount'
},record),
items : [
{
xtype:'textfield', //类型
fieldLabel:'名称',
width : 200,
allowBlank : false, //验证是否为空
blankText : '当事人名称不能为空'
name : 'tpartytype.partytypename' //定义元素名称
},
{ //放置隐藏域修改用
xtype: 'textfield',
name: 'tpartytype.id',
id: 'tpartytype.id',
hidden: true,
hideLabel:true
},
{ //放置隐藏 把多有参数写满/看有无关系
xtype: 'textfield',
name: 'tpartytype.partytypecode',
id: 'tpartytype.partytypecode',
hidden: true,
hideLabel:true
}
],
buttons:[
{
text : '提交',
handler : submitForm
},
{
text : '关闭',
handler : function(){
win.hide();
}
}
],
keys:[{key: [10,13],fn:submitForm}] //键盘事件 提交 fn:对应提交handler
});[/code]
[table]
|结果如下图:|
[/table]
[img]http://dl.iteye.com/upload/attachment/446580/58b7e537-ebc9-38c4-b760-eb240f770239.png[/img]
[size=large][color=red][b]问题:[/b][/color][/size]
我怎么才能把查到的数据放到上面的结果图中呢?因为我现在更新总是做插入,我的隐藏域ID传过去。请大家给下方法,我新手刚学。
[table]
|备注,load()交互的查询结果如下:|
[/table]
[code="java"]{root:[{"userlogDescription":"当事人类型名称为:gggggggg","partytypename":"gggggggg","systemlogDescription":"","partytypecode":"","searchenddate":"","searchstartdate":"","id":"14ED820E_8D8F_BFB1_37E4_AF156A3FFE88"}]}
[/code]
[b][color=red]这是我的全部积分,大家帮助谢谢![/color][/b]