Reputation: 8008
This is what I am trying to achieve:
Whenever a user selects a row for editing, I want to check the value of that row for a particular column. If the value that I am looking for is found then I want to display a message and close the edit dialog box. So far, This is what I have come up with:
// Options for EDIT
{height:280,mtype: "POST",closeAfterEdit: true,reloadAfterSubmit:true, url:'gridedit.jsp',
recreateForm: true,
//set some properties beofre the dialog box is seen by the user
beforeShowForm: function(form) {
/*$('#adate',form).attr('readonly','readonly');
$('#account',form).attr('hidden','true');*/
$('#adate',form).hide();
$('#account',form).hide();
var sel_id = $("#list").jqGrid('getGridParam', 'selrow');
var value = $("#list").jqGrid('getCell', sel_id, 'mod');
if(value=='n'){
alert('NOOOOOOOOOOOOOOO!')
}
}
}
after the alert, how do i close the edit dialog box ? right now the dialog box appears after the alert.
Upvotes: 0
Views: 521
Reputation: 8008
found the answer:
i just have to write
form.close();
after the alert
Upvotes: 1