PDA

View Full Version : Combobox in grid with row editing



MichaelEr
22 Apr 2013, 4:10 AM
Hi together,
I think I got a simple problem but could not find a solution. I defined a grid with a few columns. The model is defined like this:

id:'string', name:'string', refId:'string', 'refText':'string'
when defining the columns, I used the property refText as dataIndex for the column. The refId should not be displayed in the grid.
I enabled row editing with the plugin.
When selecting a row for editing, a combobox should be displayed for the refText column, and the item with the id referenced in the refId property should be selected by default. When the update button is clicked the refName value should be the name of the selected combobox entry, and the refId should have the id of the combobox entry.
How to realize this. I played around for two days now and could not find a working solution. I tried to play with the afterrender and the change listener on the combobox as well with the beforeedit listener of the plugin, but nothing works.
Any suggestions or examples? Thanks in advance.

Kind regards


Environment: Ext 4.0.7

MichaelEr
22 Apr 2013, 10:48 AM
This blog post (https://coderwall.com/p/ebs8na) gives me the right hint.
I had to set the dataIndex to 'refId' and to specify a tpl like this:

dataIndex : 'refId', xtype : 'templatecolumn', tpl : '{refName}'