PDA

View Full Version : cannot transform a select twice



lkasdorf
21 Nov 2009, 8:12 PM
I have a tabpanel based app with different grids in each tab. I want to have a combobox editor in two grids that will have the same values, so naturally I figured I'd define a select in html, and then transform it into the combobox editor for the 2 grids.

However, it seems that I cannot do this- once the first grid's combobox transforms the select, this cannot be done again (I get the mysterious "c is null" error). I worked around this by defining 2 identical selects, and giving them different ids.

Is this expected behavior?

The following code will fail because 2 different combos are attempting to transform the same select.



<select name="userType1" id="userTypeId" style="display: none;">
<option value="admin">Admin</option>
<option value="suser">SuperUser</option>
<option value="user">User</option>
</select>


in tab 1, a grid of type "usergrid"


...
,{
dataIndex: 'type'
,hidden:false
,id: 'typeID'
,header: 'Access Level'
,align: 'center'
,sortable: true
,locked: false
,width:65
,editor: new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
// transform the data already specified in html
transform: 'userTypeId',
lazyRender: true,
listClass: 'x-combo-list-small'
})
}
...


in tab 2, grid of type "docgrid"


,{
dataIndex: 'access'
,hidden:false
,id: 'accessID'
,header: 'Access Level'
,align: 'center'
,sortable: true
,locked: false
,width:65
,editor: new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
// transform the data already specified in html
transform: 'userTypeId',
lazyRender: true,
listClass: 'x-combo-list-small'
})
}