Note that there are some explanatory texts on larger screens.

plurals
  1. POWrong onclicksubmit being fired for jqGrid
    primarykey
    data
    text
    <p>It seems like wrong onClickSubmit is being fired. On loading the grid if i click on edit button and submit the onclicksubmit of the edit fires which is correct. but when i click on add the onclicksubmit of the edit fires!</p> <p>If i reload the page and click on Add the onClickSubmit of the add fires which is correct, next i try to edit the onclickSubmit of the Add fires.. Please help!!</p> <p>here is the code for </p> <pre><code> jQuery("#treegrid").jqGrid('navGrid', '#ptreegrid', { view:true, refresh:true, search:false},//options {width:700, height:300, checkOnSubmit:true, reloadAfterSubmit:true, ajaxEditOptions: { contentType: 'application/json; charset=utf-8' }, closeAfterEdit:true, closeOnEscape:true, bottominfo:"Fields marked with (*) are required", afterShowForm: function(eparams) { jQuery("#treegrid").setGridParam({datatype:'json'}); }, onclickSubmit: function(rp_ge, postdata) { var rowid = jQuery("#treegrid").getGridParam('selrow'); var rowdata = jQuery("#treegrid").getRowData(rowid); rp_ge.url = '../v1/OutlineItem?'+'&amp;text='+$.URLEncode($("#text").val())+'&amp;oper=edit'+ '&amp;id='+rowid; } }, // edit options end {width:700, height:300, checkOnSubmit:true, reloadAfterSubmit:true, closeAfterAdd:true, processData:"Processing", ajaxAddOptions: { contentType: 'application/json; charset=utf-8' }, closeOnEscape:true, bottominfo:"Fields marked with (*) are required", afterShowForm: function(eparams) { jQuery("#treegrid").setGridParam({datatype:'json'}); }, onclickSubmit: function(rp_ge, postdata) { var rowid = jQuery("#treegrid").getGridParam('selrow'); var rowdata = jQuery("#treegrid").getRowData(rowid); rp_ge.url = '../v1/OutlineItem?'+'&amp;text='+$.URLEncode($("#text").val())+'&amp;oper=add'+ '&amp;id='+rowid; } }, // add options end {reloadAfterSubmit:true,closeOnEscape:true, mtype:"DELETE", ajaxDeleteOptions: { contentType: 'application/json; charset=utf-8' }, serializeDelData: function (postdata) { return ""; // the body MUST be empty in DELETE HTTP requests }, onclickSubmit: function(rp_ge, postdata) { var rowid = jQuery("#treegrid").getGridParam('selrow'); var rowdata = jQuery("#treegrid").getRowData(rowid); rp_ge.url = '../v1/OutlineItem?'+'id='+rowid; } }, // del options {closeOnEscape:true} // search options ); jQuery("#treegrid").jqGrid('navButtonAdd',"#ptreegrid", {caption:"",title:"Move Up", buttonicon :'ui-icon-arrowthick-1-n', onClickButton:function(){ var rowid = jQuery("#treegrid").getGridParam('selrow'); jQuery("#selOutlineItemIdField").val(rowid); var temp = jQuery("#selOutlineItemIdField").val(); $.ajax({ type: 'POST', contentType: 'application/json; charset=utf-8', accepts: 'application/json; charset=utf-8', url: '../v1/OutlineItem?oper=up&amp;id='+rowid, data: 'oper=up&amp;id='+rowid, </code></pre> <p>// dataType: 'json', async: false, cache: false, error: function(){ }, success: function(data) { jQuery("#treegrid").trigger("reloadGrid"); jQuery("#treegrid").jqGrid('setSelection',temp); } });<br> } });</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload