Forum

July 12th, 2025
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_TopicIcon
Cell Editing / How to disable or remove a checkbox in some cells
28/08/2009
09:46
Avatar
zerikv
Member
Members
Forum Posts: 9
Member Since:
12/06/2009
sp_UserOfflineSmall Offline

Hi,

I use the cell editing (with jqGrid 3.5.2) and I need to disable or remove an input element (checkbox) depending on the context of each row.

I use the callback afterInsertRow() to do that:

    To disable the checkbox:
   
        $("#gridid  tr[id='"+rowid+"'] > td:eq(6) > input").attr("disabled",true);
       
    To remove the checkbox:
   
        $("#gridid  tr[id='"+rowid+"'] > td:eq(6)").html("");
       
The problem is that jqGrid is "too" smart because it restores the checkbox and activates it when I click on the row.

Is it possible to keep the input element in the state set by afterInsertRow with the API (without modifying the code in grid.celledit.js) ?

Thanks for your advice.
~~~
Eric

28/08/2009
12:33
Avatar
zerikv
Member
Members
Forum Posts: 9
Member Since:
12/06/2009
sp_UserOfflineSmall Offline

Hi,

To solve my problem I have inserted in grid.celledit.js at the line 61 (of 3.5.2) this test:

if(cc[0].innerHTML.length==0 || cc[0].innerHTML.indexOf("disabled")!=-1){
     return;
}

It's dirty, but it works...

~~~

Eric

28/08/2009
12:58
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Couldnt you use the formatCell or beforeEditCell event instead?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

Currently Online:
16 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