lghclub 2009-06-18 14:08
浏览 238
已采纳

获取不到选择ext某一列的数据

function showeditPanel()

{

var record = grid.getSelectionModel().getSelected()

if(!record){

Ext.Msg.alert('信息','请选择要编辑的数据');

return;

}

if(!editWindow)

{

editWindow = new Ext.Window({

el: 'edit_win',
title:'编辑记录',

width: 650,

height: 360,

closable: false,

closeAction: 'hide',

resizable: false,

items: editForm
});

            }  

            editWindow.show(Ext.get('editDataButton'));


          editWindow.getForm().loadRecord(record); [color=red]为什么这里获取不到value[/color]        
        } 

editForm = new Ext.FormPanel( {
title: 'title',
frame: true,
width: 300,
labelAlign: 'right',
labelWidth: 60,
defaultType: 'textfield',
defaults: {
width: 200,
allowBlank: false
},
defaultType : 'textfield',
items : [{
id:'ids',

name : 'model.id'
},{
fieldLabel : '名字',
name : 'model.name'
},{
fieldLabel : 'itemName',
name : 'model.itemName'
},{
fieldLabel : 'itemValue',
name : 'model.itemValue'
},new Ext.form.TextArea( {
fieldLabel : 'remark',

name : 'model.remark'
}
)],

buttons : [{
text: '保存',
handler: function() {
if (editForm.form.isValid()) {
editForm.form.doAction('submit',{
url : 'save.html',
method:'post',
success: function(form, action){
Ext.Msg.alert('success', action.result.info);
ds.load();
editForm.reset();
editWindow.hide();
},
failure : function(form, action) {
Ext.Msg.alert('修改失败', '添加级别失败!');
}
});
}
}
},{
text : '取消',
handler : function() {
editWindow.hide();
}}
]

    }); 

var grid = new Ext.grid.GridPanel( {**************})

  • 写回答

3条回答 默认 最新

  • zhoujuan520 2009-06-18 14:19
    关注

    alert(editWindow.getForm());//你先这样看能或得到form不咯?

    如果得不到那就这样

    editWindow.items.itemAt(0).getForm().loadRecord(record);

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题