PDA

View Full Version : Multiselect combobox problem (Ext.ux.Andrie.select)



yagi
23 Jun 2010, 7:59 PM
Hi all..
I have some combobox and one of them is multiselect combobox using Ext.ux.Andrie.Select. It works fine when multiple data are selected and saved into database but when I want to edit a record through gridPanel using rowActions, the combobox do not select multiple data rendered througth gridPanel.
Here is my snippet code :
My JSON Store


newhid.core.vims_comp_group.comboStoreSite = Ext.extend(Ext.data.JsonStore, {
constructor: function(config){
config = config || {};
config.pruneModifiedRecords= true,

config.url = config.url || (baseHref + newhid.core.vims_comp_group.controller+'/getSite');
config.root = config.root || 'rows';
config.fields = [
{name: 'idsite', mapping: 'idsite'},
{name: 'sitename', mapping: 'sitename'}
];
config.autoLoad = true;

newhid.core.vims_comp_group.comboStoreSite.superclass.constructor.call(this, config);
}
});

newhid.core.vims_comp_group.comboStoreFleet = Ext.extend(Ext.data.JsonStore, {
constructor: function(config){
config = config || {};
// config.pruneModifiedRecords= true,
config.url = config.url || (baseHref + newhid.core.vims_comp_group.controller+'/getFleet');
config.root = config.root || 'rows';
config.fields = [
{name: 'idfleet', mapping: 'idfleet'},
];

newhid.core.vims_comp_group.comboStoreFleet.superclass.constructor.call(this, config);
}
});

newhid.core.vims_comp_group.comboStorePrefix = Ext.extend(Ext.data.JsonStore, {
constructor: function(config){
config = config || {};
config.url = config.url || (baseHref + newhid.core.vims_comp_group.controller+'/getPrefix');
config.root = config.root || 'rows';
//config.totalProperty = config.totalProperty || 'total',
config.fields = [
{name: 'idprefix', mapping: 'idprefix'},
];
newhid.core.vims_comp_group.comboStorePrefix.superclass.constructor.call(this, config);
}
});



My Multiselect Combobox:


xtype: 'select',
fieldLabel: 'Prefix',
id: 'prefixCombo',
hideOnSelect : true,
minChars : 3,
width: 200,
disabled: true,
multiSelect : true,
forceSelection : false,
selectOnFocus : true,
name: 'idprefix',
store: new newhid.core.vims_comp_group.comboStorePrefix(),
displayField : 'idprefix',
mode:'local',
valueField : 'idprefix',
editable: true,
emptyText: 'Select Prefix',
triggerAction: 'all',
minChars:2,
typeAhead : true,
// lazyRender: true,
loadingText: 'Please Wait...'


rowAction function for editing record:


'icon-edit-record': function(grid, record, action,row, col) {
config.actionButtons.form.getForm().loadRecord(record);
// console.log(record);

Ext.getCmp('action').setValue('edit');

fleet = Ext.getCmp('fleetCombo');
fleet.enable();
fleet.store.load({
params:{'site': Ext.getCmp('siteCombo').getValue()}
});

prefix = Ext.getCmp('prefixCombo');
prefix.enable();
prefix.store.load({
params:{'site': Ext.getCmp('siteCombo').getValue(),
'fleet' : Ext.getCmp('fleetCombo').getValue()
}
});

}


For Screenshot
21089

can someone help me to solve this?

Thanks