PDA

View Full Version : RowEditor with Combobox and Data submission: ed is undefined and other problems



Tumac
19 Dec 2010, 9:10 AM
If someone could please help point me in the right direction here. Maybe I should use RowActions and add a "Save" button to all my rows and ditch RowEditor?

I am trying to use RowEditor in my grid with custom editor comboboxes (several - only 1 example here) defined as variables and directly in the column model. In both cases I get "ed is undefined" unless I use Ed Spencers hack to RowEditor to use my renderer.

http://edspencer.net/2009/10/making-roweditor-use-your-column-renderers.html/comment-page-1 (http://edspencer.net/2009/10/making-roweditor-use-your-column-renderers.html/comment-page-1)

this makes my stuff work, but it imposes a problem where if I do not change one of my comboboxes, the data submits the display value and not my hiddenvalue of the comboboxes. All my combo boxes display a "description" but submit a keyID value.

Also I use Ex.util.Format.USMoney for 2 columns, and if I do not change the value in that column, they get submitted as $xx.xx (with the $ instead of the raw number).

In both cases of submission, the data is invalid "blanks" the value in the database.

Reality is that I only want to send "updated" columns to the database.


,columns :
[
{header: "Mill", dataIndex: 'millShort',width:75, editor: new Ext.form.ComboBox({
typeAhead: true
,triggerAction: 'all'
,name: 'millID'
,id: 'millEdit'
,displayField:'millShort'
,editable:false
,valueField: 'millID'
,hiddenName: 'millID'
,store: {
xtype: 'jsonstore'
,url: '?c=lookup&m=mills'
,autoLoad: false
,fields: ['millID','millShort','millName']
}
,listClass: 'x-combo-list-small'
})
}
....


and


var mill_edit = new Ext.form.ComboBox({
typeAhead: true
,triggerAction: 'all'
,name: 'millID'
,id: 'millEdit'
,displayField:'millShort'
,editable:false
,valueField: 'millID'
,hiddenName: 'millID'
,store: {
xtype: 'jsonstore'
,url: '?c=lookup&m=mills'
,autoLoad: false
,fields: ['millID','millShort','millName']
}
,listClass: 'x-combo-list-small'
});
....
,columns :
[
{header: "Mill", dataIndex: 'millShort',width:75, editor: mill_edit}
...