Forum
14:57
09/01/2009
I am trying to use cell editing with a check box. The issue is if the checkbox was previously checked "Yes" and I try to change it to No (unchecked), then use then mouse to click another cell the value does not get saved to "No" ie unchecked. If I use the tab key to move to the next cell everything works OK since saveCell() is called instead of editCell(). If I do the same operation and the value was previously unchecked then changing to checked and clicking on a different cell does save the checked (Yes) value successfully.
The difference is in editCell: the lines:
var vl = $("td:eq("+$t.p.savedRow[0].ic+")>#"+$t.p.savedRow[0].id+"_"+$t.p.savedRow[0].name,$t.rows[$t.p.savedRow[0].id]).val();
if ($t.p.savedRow[0].v != vl) {
// save it
$($t).saveCell($t.p.savedRow[0].id,$t.p.savedRow[0].ic)
} else {
// restore it
$($t).restoreCell($t.p.savedRow[0].id,$t.p.savedRow[0].ic);
}
The value for vl for the 'yes' -> 'no' case is 'yes' instead of 'no'. Thus when comparing it to the saveCell value, it is the same so it restores it. In the 'no' -> 'yes' case the two values are different this saveCell is called.
I tried both the 3.4.1 and 3.3.2 version with same result. I am also using 'clientArray'.
15:12
09/01/2009
In my version I tried commenting out these lines
// // if so check to see if the content is changed
// var vl = $("td:eq("+$t.p.savedRow[0].ic+")>#"+$t.p.savedRow[0].id+"_"+$t.p.savedRow[0].name,$t.rows[$t.p.savedRow[0].id]).val();
// if ($t.p.savedRow[0].v != vl) {
// // save it
$($t).saveCell($t.p.savedRow[0].id,$t.p.savedRow[0].ic)
// } else {
// // restore it
// $($t).restoreCell($t.p.savedRow[0].id,$t.p.savedRow[0].ic);
// }
Leaving only the saveCell() line to execute and thus letting saveCell() make the decision whether the value has changed. At least in my small case it works. Don't know if will break in other scenarios.
02:00
Moderators
30/10/2007
Hello,
There is a known bug when a checkbox is used in all editing modules. I will publish second release of 3.4 soon.
Thank you
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
43 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