Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
How to dynamically make cell uneditable (inline edit mode)
08/07/2012
17:46
Avatar
XhiXhi
New Member
Members
Forum Posts: 2
Member Since:
08/07/2012
sp_UserOfflineSmall Offline

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:

onSelectRow: function(id){
        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? 

17/11/2014
21:40
Avatar
upperdeck
Member
Members
Forum Posts: 8
Member Since:
05/11/2014
sp_UserOfflineSmall Offline

I too have been trying to get around this issue?  the cancel button seems to override anything you try to do with this.. seems like a bug..  anyone else got a work around for this issue?

19/11/2014
15:36
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

19/11/2014
17:33
Avatar
upperdeck
Member
Members
Forum Posts: 8
Member Since:
05/11/2014
sp_UserOfflineSmall Offline

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. 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 496

Currently Online:
23 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information