Question

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
}
Was it helpful?

Solution

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; 
}
} 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top