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
Disable checkbox on selected rows
28/08/2013
19:16
Avatar
Pete
Member
Members
Forum Posts: 100
Member Since:
01/09/2008
sp_UserOfflineSmall Offline

I have searched and tried mutiple approaches to what I thought was a simple  issue.  I have a grid that has only one editable column and that is a checkbox.  There are a few records that I don't want a user to be able to change so I used the following code:

afterInsertRow: function(rid,rdata,relem){        

 if(rdata.position=='this' || rdata.position=='that')

$('#'+rid+'_myCellName').attr('disabled',true);

},

No joy.  The checkbox remains enabled and can be checked on and off.

I thought maybe this would work in the colModel:

{ name: 'myCellName',  index: 'myCellName', editable:false, edittype:'checkbox', editoptions: { value:'true:false'}, formatter: 'checkbox', formatoptions: {disabled : evalCheckBoxStatus()},width:60},

but I can't figure out how to get the rowID passed to the evalCheckBoxStatus() function.

I was not sure that I was getting a valid cell reference using the $('#'+rid+'_myCellName').attr('disabled',true); selectior syntax in the afterInsertRow function call but if I do this:

var cellRef = $('#'+rid+'_myCellName');

I DO get a valid object reference (but I am not sure if it is valid for what I want to use it for).  

I have also tried a selector like this:  var cbcell1 = $("input[id='#"+rid+"_myCellName'][type='checkbox']");

but I still can't set the disabled attribute.

So, what am I missing?  This seems like it should be easy but apparently I am missing something essential…..I am using jQuery 1.9.1 and jqGrid 4.5.2.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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