Forum
19:16
01/09/2008
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.
Most Users Ever Online: 715
Currently Online:
57 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