Forum
08:05
29/07/2008
Hi pat and tony,
I met the same problem, and modified the source of grid.celledit.js the following way to meet those requirements.
Here my modifications, at line 72 and following. The principe is just adding a var to receive the value and being able to test it.
Greetings,
zupert
Code :
var followEdit = true;
if ($.isFunction($t.p.beforeEditCell)) {
followEdit = $t.p.beforeEditCell($t.rows[iRow].id,nm,tmp,iRow,iCol);
}
if (followEdit !== false) {
$(cc).html("").append(elc);
window.setTimeout(function () { $(elc).focus();},0);
$t.p.savedRow.push({id:iRow,ic:iCol,name:nm,v:tmp});
$("input, select, textarea",cc).bind("keydown",function(e) {
if (e.keyCode === 27) {$($t).restoreCell(iRow,iCol);} //ESC
if (e.keyCode === 13) {$($t).saveCell(iRow,iCol);}//Enter
if (e.keyCode == 9) {$($t).nextCell(iRow,iCol);} //Tab
e.stopPropagation();
});
if ($.isFunction($t.p.afterEditCell)) {
$t.p.afterEditCell($t.rows[iRow].id,nm,tmp,iRow,iCol);
}
}
15:31
15/01/2009
Hi, Zupert, Pat and Tony!!
I also wanted to prohibit the editing of individual cells rather than the column immediately.
If you have managed styles for each cell (such as in the post Custom Cell Class) this could be quite simple: just check for class “readonly†in cell:
@@ -1351,6 +1360,7 @@
          td = (e.target || e.srcElement);
          if (td.href) { return true; }
          var scb = $(td).hasClass(â€cboxâ€);
+         var ro = !$(td).hasClass(â€readonlyâ€);
          ptr = $(td,ts.rows).parent(â€trâ€);
          if($(ptr).length === 0 ){
             ptr = $(td,ts.rows).parents(â€tr:firstâ€);
@@ -1365,7 +1375,7 @@
                } else {
                   ri = ptr[0].rowIndex;
                   ci = td.cellIndex;
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â try {$(ts).editCell(ri,ci,true,true);} catch (e) {}
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â try {$(ts).editCell(ri,ci,ro,true);} catch (e) {}
                }
             } else if ( !ts.p.multikey ) {
                if(ts.p.multiselect && ts.p.multiboxonly) {
Regards,
Serg.
Asche zu Asche...
Most Users Ever Online: 715
Currently Online:
52 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