Mar 09, 2017, 12:41 PM
[CLOSED] Combobox BindStore remove filter functionality
Hi,
We have two combobox and second combobox store change by first combo selection. first time It's working well but second and onward it's stop filtering.
e.g. on Study_Type change we bind Study_Subtype store using bindStore, as I describe above Study_Subtype destroy their filter functionality.
We have two combobox and second combobox store change by first combo selection. first time It's working well but second and onward it's stop filtering.
e.g. on Study_Type change we bind Study_Subtype store using bindStore, as I describe above Study_Subtype destroy their filter functionality.
Ext.define('MyApp.view.MyStudyType', {
extend: 'Ext.form.FieldContainer',
width: 908,
layout: {
type: 'hbox'
},
fieldLabel: '',
customStore: ["Harm","Therapy"],
customStoreTherapy: ["Therapy1", "Therapy2", "Therapy3", "Therapy4", "Therapy5", "Therapy6"],
customHarm: ["Harm1", "Harm2"],
row: 1,
initComponent: function () {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'myDropdown',
margins: '3px 5px 3px 5px',
width: 130,
store: me.customStore,
queryMode: 'local',
name: 'Study_Type',
emptyText: 'Study Type',
listeners: {
change: { fn: me.onTypeNameChange, scope: me },
select: { fn: me.onTypeNameSelect, scope: me }
}
},
{
xtype: 'myDropdown',
margins: '3px 5px 3px 5px',
width: 166,
store: me.customStoreTherapy,
name: 'Study_Subtype',
emptyText: 'Study Subtype',
hidden: true,
queryMode: 'local',
isHide: true,
row: me.row,
column: 2,
listeners: {
change: { fn: me.onOtherTypeNameChange, scope: me },
select: { fn: me.onOtherTypeNameSelect, scope: me }
}
}
]
});
me.callParent(arguments);
},
onTypeNameChange: function (combo, newValue, oldValue, eOpts) {
var a = combo.up();
if (newValue == "Therapy") {
a.query("[name='Study_Subtype']")[0].setValue('');
a.query("[name='Study_Subtype']")[0].bindStore(this.customStoreTherapy);
a.query("[name='Study_Subtype']")[0].show();
}
else if (newValue == "Harm") {
a.query("[name='Study_Subtype']")[0].setValue('');
a.query("[name='Study_Subtype']")[0].bindStore(this.customHarm);
a.query("[name='Study_Subtype']")[0].show();
}
}
});
Combobox BindStore remove filter functionality
Last edited by fabricio.murta; Mar 24, 2017 at 3:49 PM.
Reason: No user feedback in 7+ days