Quote from: BobRay at Oct 25, 2015, 04:12 PMYou may have to override the save() method.
Thanks Bob. I modified the id name to be id. Just much simpler. All works now;)
My last two issues are:
1. how to update mapping table data from within my new and update forms. I have a many to many with a Categories table and am looking for examples on a.) how to render the categories (maybe a checkbox group would work), and b.) then how to update the mapping table.
2. how to get the grid to render the display values on load for my comboboxes. They are working fine in the forms, and load when I click to edit, but everything I've read a tried doesn't work .
My combo.store looks like this:
Recroot.combo.Companies = function(config) {
config = config || {};
Ext.applyIf(config,{
displayField: 'name'
,valueField: 'company_id'
,mode: 'remote'
,store: new Ext.data.JsonStore({
url: Recroot.config.connectorUrl,
// store configs
autoDestroy: false,
baseParams: {
action: 'mgr/company/getlist',
combo: true
},
storeId: 'companyStore',
// reader config
root: 'results',
idProperty: 'company_id',
autoLoad: true,
typeAhead: true,
valueNotFoundText: 'Entry not found',
fields: ['company_id', 'name'],
tpl: new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item"><span style="font-weight: bold">{name}</span>'
,' ({code})</div></tpl>')
})
,editable: true
,emptyText: 'Company...'
});
Recroot.combo.Companies.superclass.constructor.call(this,config);
};
Ext.extend(Recroot.combo.Companies, MODx.combo.ComboBox);
Ext.reg('Companies-combo', Recroot.combo.Companies);
Ad the grid column is set to this:
{
header:_('recroot.position_header_company')
,dataIndex: 'company'
,sortable: true
,width: 50
,hiddenName: 'company'
,editor: { xtype: 'Companies-combo', renderer:'true'}
}
Could this issue also be related to the id not being "id"? The combos do work in the forms. They just display the id in the column in the grid instead of the displaytext.