Forum


02:31

01/09/2008

I found some code that Oleg posted here: http://www.ok-soft-gmbh.com/jq.....ynamic.htm that shows how cell editing can be dynamically controlled. The only problem is that it uses a cell editing approach rather than a row editing approach which breaks my application.
Preventing editing on the column by setting the column editable= false works for existing records but when I add a new row to the grid I want all the columns in the empty row to be editable so new data can be entered.
Can you think of any way to accomplish this? If seems that the inline editing doesn't allow for modifications of the cell attributes (like setting the class = 'not-editable-cell' or removing the class). I want one column to NOT be editable *except* when a new row is added that has empty cell content. Ideas? (running 3.8.2 of jQGrid currently)
Thanks!
19:00

01/09/2008

A little trial and error got this to work. In my onSelectRow function I added this:
var grid = $('#myGrid');
var colContent = grid.jqGrid('getCell',id,'myColumn');
if(colContent.length>0)
grid.setColProp('myColumn',{editable:false});
else
grid.setColProp('myColumn',{editable:true});
This does exactly what I was hoping to do. When I have a column that already has content that I want to "protect" from editing, this makes the column not editable. But when I have blank data, I can edit the field.
Posted here so if someone comes across the same issue they can get a quick solution.
01:38

10/08/2009

Hello Pete,
You posted link to my old code from the answer so I decide that I should wrote you. If you use inline editing you can set "not-editable-row" class to disable editing of some rows (see here for example).
Look at the answer or this one in case of inline editing and the answer for the form editing. The solution which you found yourself use the same technique.
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
32 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