We are using SmartGWT Power (nightly of 30-11)
In our program we work with grids which contain a fair amount of records (more then thousand) and we want to have multiselect possibilities. We know this is possible with SelectionStyle.MULTIPLE and SelectionAppearance.CHECKBOX but this is a bit limited. For example if there are too many records in the grid the 'select all' checkbox in the header will not work when you use paging (disabling that will not work).
To fix this we just have our own extra column with checkboxes and a filtereditor checkbox and try to do everything as well as we can. However this gets really tedious: the grid tries to store the edits on the select field, the 'select all' item does not get disabled, and a lot of other seemingly trivial but time-consuming bugs.
Our 'select all' behaviour works like this:
- When there are less than 100 records in the grid, just select all records (and fetch the missing ones)
- When there are less than 1000 records, ask the user for confirmation and then fetch the missing ones
- If there are more than 1000 records, we never fetch the missing values (but if some action occurs we just send the criteria to the server)
However in another recent struggle with this I found that there is a method getCheckBoxItem() in smartclient that you can override. I think this could be exactly what we need: we can set the filterEditorType of this checkbox to have our own checkbox, which we can disable and enable when we want. We can add changeHandlers to it to provide our dialogs etc...
My question is twofold
- Do you think this might be a valid approach?
- How do I override this method, their is no SmartGWT wrapper and would need to call some java code.
In our program we work with grids which contain a fair amount of records (more then thousand) and we want to have multiselect possibilities. We know this is possible with SelectionStyle.MULTIPLE and SelectionAppearance.CHECKBOX but this is a bit limited. For example if there are too many records in the grid the 'select all' checkbox in the header will not work when you use paging (disabling that will not work).
To fix this we just have our own extra column with checkboxes and a filtereditor checkbox and try to do everything as well as we can. However this gets really tedious: the grid tries to store the edits on the select field, the 'select all' item does not get disabled, and a lot of other seemingly trivial but time-consuming bugs.
Our 'select all' behaviour works like this:
- When there are less than 100 records in the grid, just select all records (and fetch the missing ones)
- When there are less than 1000 records, ask the user for confirmation and then fetch the missing ones
- If there are more than 1000 records, we never fetch the missing values (but if some action occurs we just send the criteria to the server)
However in another recent struggle with this I found that there is a method getCheckBoxItem() in smartclient that you can override. I think this could be exactly what we need: we can set the filterEditorType of this checkbox to have our own checkbox, which we can disable and enable when we want. We can add changeHandlers to it to provide our dialogs etc...
My question is twofold
- Do you think this might be a valid approach?
- How do I override this method, their is no SmartGWT wrapper and would need to call some java code.
Comment