Opened 12 years ago
Closed 8 years ago
#8351 closed defect (patchwelcome)
onApplyCellEdit for cells with dojox.grid.cells.Bool type is called 2 times (except the first time)
Reported by: | Kenny | Owned by: | Bryan Forbes |
---|---|---|---|
Priority: | high | Milestone: | future |
Component: | DojoX Grid | Version: | 1.2.3 |
Keywords: | grid cell checkbox onApplyCellEdit | Cc: | |
Blocked By: | Blocking: |
Description
Hello,
Check my example. I put an alert in the onApplyCellEdit function. Click on the checkbox more than 1 time to see the problem.
Kenny
Attachments (1)
Change History (8)
Changed 12 years ago by
comment:1 Changed 12 years ago by
I forgot to mention:
The problem appears on FF3, IE7 & GC
++ Kenny
comment:2 Changed 12 years ago by
Milestone: | tbd → 1.3 |
---|
comment:3 Changed 12 years ago by
I discovered, I think the source of the problem.
In the case of a type:dojox.grid.cells.Bool in a grid, the 'onApplyCellEdit' function is called before the 'onStartEdit' function.
And when you focus on another cell / row (or maybe the onblur of the Bool), the 'onApplyCellEdit' function is called a second time.
Hope this help
Kenny
comment:4 Changed 12 years ago by
For those who have the same problem, here is a workaround:
Instead of checking the difference between the old value and the new value in the 'onApplyCellEdit' function for the type:dojox.grid.cells.Bool, do nothing like:
var fct_OnApplyCellEdit = function (inValue, inRowIndex, inFieldIndex) {
if (inFieldIndex != "the name of your Bool field") {
do your stuff to control the value of your cell
}
}
And in 'onStartEdit' function you catch the change and do your stuff:
var fct_OnStartEdit = function (inCell, inRowIndex) {
if (inCell.field == "the name of your Bool field") {
do the stuff for your Bool type cell like an ajax request to update the data.
} else {
do the normal stuff
}
}
comment:5 Changed 12 years ago by
Milestone: | 1.3 → future |
---|
comment:6 Changed 8 years ago by
comment:7 Changed 8 years ago by
Resolution: | → patchwelcome |
---|---|
Status: | new → closed |
example with the problem (just change the path to dojo)