-5

单击一行或单击我的自定义按钮时,我需要显示一个编辑表单。我可以获得被点击的行的 id,但是如何显示表单并编辑该行?

4

2 回答 2

2

利用jQuery("#grid_id").jqGrid('editGridRow', rowid, properties );

有关更多详细信息,请参阅JQGrid 表单编辑

于 2013-08-21T09:00:26.003 回答
-1

通常我会使用一个对话框来显示表单。这是示例代码,看看是否满足您的要求

$('#button').click(function () {
            showDialog("Your URL ",'TITLE', 400, 320);
        });



    function showDialog(url, title, iwidth, iheight) {

var dialog = $('<div id="divpopup"><iframe id="iframedit" src="' + url + '" style="width:' + iwidth + 'px;height:' + iheight + 'px;"  frameborder="0" ></iframe></div>').appendTo('body');
//dialog.remove();
dialog.dialog({
    title: title,
    autoResize: true,
    height: 'auto',
    width: 'auto',
    modal: true,
    position: 'center',
    draggable: true,
    open: function (type, data) { },
    close: function (type, data) { }
})
);
}
于 2013-08-21T08:54:12.260 回答