Forum
17:46
08/07/2012
How best do I dynamically disable edit (per row) on a particular cell depending on the value of another cell? Thus, (for each row in a grid), if cell A meets my set criteria/condition, I want to disable edits on cell B. The grid's in inline edit mode.
I got this working with the onSelectRow event -- All cells are editable by default and I set the cell to uneditable based on meet a set condition as in this example below:
var ret = jQuery(list).jqGrid('getRowData',id);
if (ret.Arrived=='Yes')
{
jQuery(list).setColProp('Arrived',{editable:false});}
else { jQuery(list).setColProp('Arrived',{editable:true});}}
But, each time the user cancels an edit, all cells are reverted back to their initial state of editable and my event above does not fire in this case.
How do I get this working both on initial load and after every edit or edit/cancel event?
15:36
Moderators
30/10/2007
Hello,
Â
If you have trouble with the cancel button you can use afterrestorefunc - please look the docs.
Â
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
17:33
05/11/2014
I thought the afterrestore function does not get called when cancel is clicked from reading other discussions.
Â
from the example above i see the same results. I want the cell to editable on add and not on edit. when you add code like the original user did the cell works properly except when you click the cancel button.  if you click add it works, if you click edit it works. but if you click edit then cancel then click add, the cell is left in the non-edit state. if you cancel and then click add again it starts working again.
if i put alerts in and display the editable property its correct but its not used.. this tells me that the value of editable is decided before onselectrow is fired to reset it.
if i put alert in the afterrestore it is never called.Â
this issue only seems to happen when cancel is called when it edit mode.Â
Most Users Ever Online: 715
Currently Online:
66 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66