Hi,
I have a custom CMP that is using a superBoxSelect, this is working in terms of saving values.
But if I update a row then it’s not populating the values that have been saved in the database.
Code for selectBox
imagelibrary.combo.Categories = function(config) {
config = config || {};
Ext.applyIf(config,{
xtype: 'superboxselect',
allowBlank: true,
msgTarget: 'under',
allowAddNewData: true,
addNewDataOnBlur: true,
pinList: false,
resizable: true,
name: config.name + '[]',
anchor: '100%',
minChars: 1,
store: new Ext.data.JsonStore({
id: 'id',
root: 'results',
autoLoad: true,
autoSave: false,
totalProperty: 'total',
fields: ['id','title'],
url: imagelibrary.config.connectorUrl,
baseParams: {
action: 'mgr/categories/getlist'
}
}),
mode: 'remote',
displayField: 'title',
valueField: 'id',
triggerAction: 'all',
extraItemCls: 'x-tag',
expandBtnCls: 'x-form-trigger',
clearBtnCls: 'x-form-trigger',
hiddenName: config.name || 'id',
});
imagelibrary.combo.Categories.superclass.constructor.call(this,config);
if (config.storeLoadListener) {
this.store.on('load', config.storeLoadListener, this);
this.on('render', function() {
if (!this.getValue()) {
this.store.load();
}
});
}
};
Ext.extend(imagelibrary.combo.Categories, Ext.ux.form.SuperBoxSelect);
Ext.reg('imagelibrary-combo-categories',imagelibrary.combo.Categories);
And code used for the field in the update window:
{
xtype: 'imagelibrary-combo-categories'
,fieldLabel: _('imagelibrary.item.image_categories')
,name: 'image_categories[]'
,anchor: '100%'
,autoLoad: true
}
Note values stored in the DB are a comma separated list.
Any ideas?