Bug #2717
closedIncorrect sort after edit in Widget Gallery Category Chart example
0%
Description
The category chart example in the widget gallery can produce incorrect sort orderings on a column if one or more fields in the column are edited. I don't believe the issue is browser dependent, but I tested with chromium 32.0.1700.123 Debian 7.4 (248368) and the latest github version of Wt 3.3.2-rc1-24-gb6a1a4e. The issue can (currently) also be observed at: http://www.webtoolkit.eu/widgets/graphics-charts/category-chart. To reproduce the issue, browse to the above page and:
- Click on the last entry of the second column ("Rural Male"). It should have the value "12".
- Change the value to "2" and press enter.
- Sort the column by clicking on the column header ("Rural Male").
- The Rural Male column should now be in ascending order with the value "2" in row 1. Instead, the value "2" will be in row 5.
- If you repeatedly click on the "Rural Male" column header, the value "2" will sequence through rows 1, 4, 4, and back to 5,
I've attached a patch which seems to address the issue (see comments on patch). The patch has only been lightly tested and includes a modification to discard edits if escape is pressed or the mouse is clicked outside the edited field (blur). If you can suggest a better approach, I'd be happy to submit a revised patch.
Files
Updated by Bruce Toll almost 11 years ago
Hey Koen,
I forgot to log-in, but I submitted the (minor) issue above.
Regards,
Bruce
Updated by Koen Deforche almost 11 years ago
- Status changed from New to Resolved
- Assignee set to Koen Deforche
- Target version set to 3.3.2
Hey Bruce,
I've resolved this in the model by using WStandardItemModel::setItemPrototype() and overriding setData().
Regards,
koen
Updated by Bruce Toll almost 11 years ago
Hey Koen,
Thanks for the explanation. I'm looking forward to the new release.
Regards,
Bruce
Updated by Koen Deforche almost 11 years ago
- Status changed from Resolved to Closed