PDA

View Full Version : RowEditor Grid: Cannot reuse comboBox in columnModel editor function? "f is undef"



Tumac
18 Feb 2010, 10:04 AM
I have a grid using RowEditor.js

When I click my 'Add' button, I get (Firebug):

f is undefined
f.setValue(val); RowEditor Line 168

Here is my column Model:

If I make an identical comboBox called comboUOM2 and change the second (item_uom) to reference the new comboUOM2 for the editor, I do not get the error. I really do not want to be making duplicate copies of code when it is not necessary.



,columns: [
{header: "poID", dataIndex: 'poID',hidden:false}
,...
,{header: "U/M", dataIndex: 'qty_uom', width:50,editor: comboUOM}
,...
,{header: "U/M", dataIndex: 'item_uom', width:50,editor: comboUOM}


I am not very good at code re-use yet. Here is my comboBox definitions. Should I be setting these up different so when I want to use a lookup combo like this, my editor statement says

editor: new comboUOM ???



var comboUOM = new Ext.form.ComboBox({
triggerAction: 'all'
,id:'comboUOM'
,fieldLabel: 'U/M'
,mode: 'local'
,store: uomStore
,displayField:'uomDesc'
,valueField: 'uomID'
,hiddenName:'uomID'
});

var comboUOM2 = new Ext.form.ComboBox({
triggerAction: 'all'
,id:'comboUOM2'
,fieldLabel: 'U/M'
,mode: 'local'
,store: uomStore
,displayField:'uomDesc'
,valueField: 'uomID'
,hiddenName:'uomID'
});

JohDut
8 May 2010, 2:29 PM
I'm having the same problem.
And as being new to ExtJS am unable to solve this.

The 'new' statement you suggest, was simple enough to try, but does not work.

Any hint into the right direction would be appreciated.

Basically the question is: Can one reuse the same editor (in my case defined as combobox) for multiple columns.

Current behavior is that editting works for the column you start with, but not for others. When you reload the grid, it works on that column. But never on multiple columns in one pageload.