Skip to content
Snippets Groups Projects
Commit e8d208af authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Find a solution for the problem appearing on the first click.

parent caee0fbd
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,8 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, { ...@@ -42,7 +42,8 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, {
*/ */
initComponent: function () { initComponent: function () {
this.lazyInit = false;
// configure a master combobox. // configure a master combobox.
// create a local store containing the values which can be used // create a local store containing the values which can be used
// to filter the master store // to filter the master store
...@@ -73,6 +74,14 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, { ...@@ -73,6 +74,14 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, {
} else { } else {
this.store.on('datachanged', this.onDataChanged, this); this.store.on('datachanged', this.onDataChanged, this);
} }
// logic to load the underlying view in the initialisation phase
// by mimicking the click by a user
// require by the filtering mechanism
this.on('render', function (combo) {
combo.onTriggerClick();
combo.collapse();
});
}, },
/** /**
...@@ -115,6 +124,7 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, { ...@@ -115,6 +124,7 @@ App.form.LinkedComboBox = Ext.extend(Ext.form.ComboBox, {
* the first value of the filtered store * the first value of the filtered store
*/ */
onDataChanged: function () { onDataChanged: function () {
var value = this.store.getAt(0).get(this.displayField); var value = this.store.getAt(0).get(this.displayField);
this.setValue(value); this.setValue(value);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment