Hello,
I've seen the flexibility offered by the custom editors in the Showcase Custom Editors sample http://www.smartclient.com/smartgwt/showcase/#grid_editing_custom_editors. All of these are using editors that are part of com.smartgwt.client.widgets.form.fields. I would like to create my own custom editor.
To help you understand my requirements, here are a few examples where an editor other than those provided might be desirable:
(a) Editing passwords - I'll want one box for the original value and a second for confirmation, as the contents will be blanked out.
(b) Selecting options from a dropdown, where a description must be lengthy. Once selected I just want to show an indicator of what has been selected, eg "A", "B", "C", but when selecting the option I want to provide more detail, eg "A - This is what option A does", etc.
(c) Selecting multiple items from a list - this might sound unsuitable for an editable table, but once selected the items can be represented by a comma separated list. If the list is too long to fit in the cell, it can be truncated and shown in full as a tooltip.
I can think of two possible approaches:
1. Extend FormItem - this is what the custom editors in the Custom Editors sample do.
2. Use ListGrid's addCellClickHandler and a check on the column number to handle clicks on cells in the column that I wish to use my editor for and then bring up an overlay panel containing a form.
I'm not sure if option 1 is feasible if the editor I need is not part of SmartClient. Option 2, is inconsistent with the "editable table" design pattern, as the editor won't appear inside the cell.
Is option 1 feasible, or is there a way that I can proceed along the lines of option 2, butt putting the form inside a cell?
Thanks,
Andrew
I've seen the flexibility offered by the custom editors in the Showcase Custom Editors sample http://www.smartclient.com/smartgwt/showcase/#grid_editing_custom_editors. All of these are using editors that are part of com.smartgwt.client.widgets.form.fields. I would like to create my own custom editor.
To help you understand my requirements, here are a few examples where an editor other than those provided might be desirable:
(a) Editing passwords - I'll want one box for the original value and a second for confirmation, as the contents will be blanked out.
(b) Selecting options from a dropdown, where a description must be lengthy. Once selected I just want to show an indicator of what has been selected, eg "A", "B", "C", but when selecting the option I want to provide more detail, eg "A - This is what option A does", etc.
(c) Selecting multiple items from a list - this might sound unsuitable for an editable table, but once selected the items can be represented by a comma separated list. If the list is too long to fit in the cell, it can be truncated and shown in full as a tooltip.
I can think of two possible approaches:
1. Extend FormItem - this is what the custom editors in the Custom Editors sample do.
2. Use ListGrid's addCellClickHandler and a check on the column number to handle clicks on cells in the column that I wish to use my editor for and then bring up an overlay panel containing a form.
I'm not sure if option 1 is feasible if the editor I need is not part of SmartClient. Option 2, is inconsistent with the "editable table" design pattern, as the editor won't appear inside the cell.
Is option 1 feasible, or is there a way that I can proceed along the lines of option 2, butt putting the form inside a cell?
Thanks,
Andrew
Comment