0

I am newbie to jqgrid. and for one requirement, I need to hide edit form that poped up when we click edit button of navbar(pager). How can I hide it based on condition.

on click of Edit button, I am checking how many rows are selected by user. if it is more than one, I need to hide edit form and need to show alert message that, they can only edit one record.

I did following but did not work.

beforeShowForm: function(form){
form.hide();
$("#editmodlist").css("display", "none"); // where I hardedcoded div that surounds edit form
}
  • Is [this](http://stackoverflow.com/questions/3405029/jqgrid-disable-form-fields-when-editing) the answer you are looking for? – Dieter De Ridder Apr 22 '14 at 10:30
  • which answer @DieterDeRidder – user3457065 Apr 23 '14 at 11:06
  • [this one](http://stackoverflow.com/a/3405961/3532897), I hope this answer can help you. – Dieter De Ridder Apr 23 '14 at 12:18
  • Thanks @DieterDeRidder. but that did not help somehow. finally I found this way. may help someone. beforeInitData: function(form){ var selRowIds = jQuery('#list').jqGrid('getGridParam', 'selarrrow'); if(selRowIds.length>1){ alert("Error"); return false; }else{ return true; } } – user3457065 Apr 24 '14 at 07:03

1 Answers1

0

just adding my solution here for better formatting of code.

beforeInitData: function(form){ 
var selRowIds = jQuery('#list').jqGrid('getGridParam', 'selarrrow');   
if(selRowIds.length>1)
{
 alert("Error"); 
return false; 
}
else
{ 
return true; 
}
}