Forum



19:16

08/07/2010

Newbie question,
I have a situation where they want to be able to add via the standard navgrid form with the key field in the first column and then edit via the inline editing using the select row option. I do not want to allow the key field in column 1 to be editable in for the inliine editing (changing the key). Does anyone have any ways to accomplish this?
TIA for any help.
22:16

08/07/2010

Actually I figured out a way to do this by leaving the field as editable in the COLMODEL and in the onSelectRow I set a global variable (edit_id) and then when I call the editrow method I pass the function oneditfunc which according to the doc is "oneditfunc: fires after successfully accessing the row for editing, prior to allowing user access to the input fields. The row's id is passed as a parameter to this function."
In that function I derived the ID's of the column that has the code I do not want them to edit and set the disabled attribute. I also set the focus to the next editable field. This way it is still available in the Add form but is disabled for inline updates. Below is some sample code.
onSelectRow: function(id){
if(id && id !== lastSel){
if (lastSel != "")
{
jQuery('#grid').restoreRow(lastSel);
}
lastSel=id;
}
edit_id = id;
jQuery('#grid').editRow(id, true, oneditfunc);
},
function oneditfunc() {
var col_id1 = '#' + edit_id + '_COMM_CODE';
var col_id2 = '#' + edit_id + '_COMM_NAME';
// alert(col_id1);
$(col_id2).focus();
$(col_id1).attr("disabled","disabled");
}
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66