View Full Version : Custom cell editor

5 Apr 2011, 12:40 AM
I would like to build a custom cell editor, which is basicly a button with menu.

Are there any pointers available on how to extend button so that it will be porperly recognized as a cell editor, etc.

Currently I just added missing functions like reset() and setValue(). It shows the button, but leaving a cell doesn't remove it, and so on, so I guess there is much more work to do.

Thank you

5 Apr 2011, 8:45 AM
Never put a button as an editor but all you have to do is set the editor config on the specific column. However I think you are going to run into problems. The editor shows when you double-click on a cell. You may need to look into doing something like the action column where you render the button to a specific cell after it has been rendered.

5 Apr 2011, 10:10 PM
I am not sure you understood me correctly.

I am not trying to put a default button to a cell renderer or similar. I was trying to extend default button in a way it would support and behave as any other default editors (like combo, just looks differently). I needed something that fits small narrow editable cells selecting a simple dropdown value - like changing a status (combobox is too big and doesn't look good squashed together into 20px cell).

What I came up with is extended button which supports and behaves as any other editor. When cell enters editing mode, it is rendered and gives user options in a simple dropdown menu.

Anyway, at the end I threw it away as I figured out that extending combobox (that looks like a button) is easier and simpler. Just had to hide input field and supply different trigger config - button looks alike. And it even supports a store by default.

Thanks anyway.