Sunday 15 July 2012

Before Submit function not firing in jqgrid -



Before Submit function not firing in jqgrid -

hi have jqgrid edit functionality through format actions. possible can utilize method beforesubmit , perfrom validation.

formatoptions: { keys: true, // want utilize [enter] key save row , [esc] cancel editing. onedit: function (rowid) { //alert("in onedit: rowid=" + rowid + "\nwe don't need homecoming anything"); }, onsuccess: function (jqxhr) { $('input[id*="gs_"]').val(""); $grid.setgridparam({ search: false, postdata: { "filters": ""} ,datatype: 'json'}).trigger("reloadgrid"); // function used "succesfunc" parameter of editrow function // (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing#editrow) /*alert("in onsuccess used remote editing:" + "\nresponsetext=" + jqxhr.responsetext + "\n\nwe can verify server response , homecoming false in case of" + " error response. homecoming true confirm response successful"); // can verify server response , interpret error // in case should homecoming false. in case onerror called homecoming true;*/ }, onerror: function (rowid, jqxhr, textstatus) { // function used "errorfunc" parameter of editrow function // (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing#editrow) // , saverow function // (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing#saverow) /*alert("in onerror used remote editing:" + "\nresponsetext=" + jqxhr.responsetext + "\nstatus=" + jqxhr.status + "\nstatustext" + jqxhr.statustext + "\n\nwe don't need homecoming anything");*/ }, aftersave: function (rowid) { //alert("in aftersave (submit): rowid=" + rowid + "\nwe don't need homecoming anything"); }, afterrestore: function (rowid) { //alert("in afterrestore (cancel): rowid=" + rowid + "\nwe don't need homecoming anything"); }, deloptions: mydeloptions } } ],

the function never getting fired. wish perfrom ajax request validation purpose ,

kidnly provide help ,

there beforesaverow in inline editing (if don't utilize old version of jqgrid). callback can't set within of formatoptions of formatter: "actions", can utilize $.jgrid.inlineedit instead:

class="lang-js prettyprint-override">$.extend(true, $.jgrid.inlineedit, { beforesaverow: function (options, rowid) { ... homecoming true; // homecoming false break submiting } });

jqgrid jqgrid-formatter

No comments:

Post a Comment