JqG​​rid - 在addRow字段上添加事件

时间:2015-04-20 21:27:29

标签: javascript jquery events jqgrid

使用jqGrid,有没有办法在加载“添加表单”对话框后更新选择字段的值?我需要根据用户在同一个“添加表单”对话框中的另一个字段上输入的数据更新选择字段上的值列表。

谢谢!

编辑:这是我的模型结构

{name:"Name",index:"Name", width:30,editable: true,editoptions:{size:"30",maxlength:"30"}},
{name:'LastName',index:'LastName', width:30,editable: true,editoptions:{size:"30",maxlength:"30"}},
{name:'Id',index:'Id',width:30, editable:true, sorttype:"text",editoptions:{size:"30",maxlength:"30"}},
{name:'Email',index:'Email', width:40, editable: true,editoptions:{size:"40",maxlength:"30"}, editrules:{custom:true, custom_func:emailFormatter}},
{name:'Option1',index:'Option1', width:20, editable: true,edittype:"select",editoptions:{value:updateOption1Values}}

我想出了如何将事件附加到Id字段。

afterShowForm: function (e) {
    $("input#Id").blur(function() {
        updateOption1Values();
          $("input#Option1").selectmenu("refresh");
        alert("Blur!");
    });
}

现在我需要更新Option1选择框。我调用updateOption1Values并操纵值,但select控件没有显示那些更改

0 个答案:

没有答案
相关问题