jqGrid viewGridRow custom button click -
all,
i have created custom button on viewgridrow
. see below code snippet. when user clicks on button want show ui dialog , perform operation , close window. within same view window user clicks next row similar functionality.
i tried adding id , checked onclick doesnt fire. how go adding onclick event on custom button? help appreciated.
class="lang-js prettyprint-override">$.extend($.jgrid.view, { bsubmit: "view details", width: 370, recreateform: true, beforeshowform: function (form) { var selrowid = $(this).getgridparam('selrow') $('<a id="viewbtn" href="#">view report<span class="ui-icon ui-icon-disk"></span></a>').addclass("fm-button ui-state-default ui-corner-all fm-button-icon-left") .prependto("#act_buttons>td.editbutton"); } });
you can alter beforeshowform
callback next example:
beforeshowform: function ($form) { var $self = $(this); $('<a id="viewbtn" href="#">view report<span class="ui-icon ui-icon-disk"></span></a>') .click(function () { var selrowid = $self.jqgrid("getgridparam", "selrow"); alert("'view' button on rowid=" + selrowid + " clicked."); homecoming false; }) .addclass("fm-button ui-state-default ui-corner-all fm-button-icon-left") .insertbefore($form.next(".edittable").find("#cdata")); }
the demo uses code displays
jqgrid
No comments:
Post a Comment