still the easiest way to get this work is to use MIGXdb and a selectboxmultiple - TV-type.
But needed this today for a custom-made-CMP and could get this work so far with this code:
bdListings.combo.Category = function (config) {
config = config || {};
Ext.applyIf(config, {
xtype:'superboxselect'
,triggerAction: 'all'
,extraItemCls: 'x-tag'
,mode: 'remote'
,width: 350
,fields: ['id','name']
,displayField: 'name'
,valueField: 'id'
,store: new Ext.data.JsonStore({
id:'id',
autoLoad: true,
root:'results',
fields: ['name', 'id', 'is_parent'],
remoteSort: true,
url: bdListings.config.connector_url,
baseParams:{
action: 'mgr/category/getcombo'
}
,listeners: {
'load': {fn:function(store, records, options ) {
this.hiddenName = 'categorylist[]';
//this.setWidth('350');
}
},scope : this
}
})
,listeners: {
'beforeselect': {fn:function(combo, record, index ) {
if (record.data.is_parent == '1'){
return false;
}
}
},scope : this
}
});
bdListings.combo.Category.superclass.constructor.call(this, config);
this.store.load();
};
Ext.extend(bdListings.combo.Category, Ext.ux.form.SuperBoxSelect);
Ext.reg('bdlisting-combo-category', bdListings.combo.Category);
in window-form-items I have:
{
name: 'categorylist',
hiddenName: 'categorylist',
fieldLabel: _('bdlistings.category')+'*',
xtype: 'bdlisting-combo-category',
allowNegative: false,
anchor: '0 0',
allowBlank: false,
id: 'bdl-win-'+config.id+'-category'
}
the only issue, I have now, is the witdth of the superboxselect.
Most times the width is ok, but sometimes the width of the whole thing gets very small.
Anybody has an Idea for an possible fix?
[Edit]
when resizing the window, the superboxselect gets back to its normal size.
[ed. note: Bruno17 last edited this post 11 years, 4 months ago.]