lu7jm
Jun 08, 2020, 3:49 AM
I have 2 ComboBoxes, in one of them when selecting an element fires an event and returns a list of elements. Selecting an item the first time doesn't load the data into the second ComboBox, but if I re-select another item the second time if it loads, why does that happen? is there any way to force load?
JavaScript Code:
var loadBulletinYears = function (ev, result) {
App.ComboBox_BulletinYears.getStore().setData(resu lt);
}
Sample: file.cshtml
<ext-combobox id="ComboBox_BulletinCountries" editable="false" displayField="Name" valueField="Code" fieldLabel="Pais" flex="1" emptyText="">
<store>
<ext-store data="Model.BulletinCountries" >
<fields>
<ext-numberDataField name="Id" />
<ext-stringDataField name="Code" />
<ext-stringDataField name="Name" />
</fields>
</ext-store>
</store>
<directEvents>
<change url="GetBulletinYears" before="extraParams.country = App.ComboBox_BulletinCountries.getValue();" success="loadBulletinYears">
</change>
</directEvents>
</ext-combobox>
<ext-combobox id="ComboBox_BulletinYears" editable="false" displayField="Year" valueField="Year" fieldLabel="Publicación Año" flex="1" emptyText="">
<store>
<ext-store autoLoad="true">
<fields>
<ext-stringDataField name="Year" />
</fields>
<sorters>
<ext-sorter property="Year" direction="DESC" />
</sorters>
</ext-store>
</store>
<directEvents>
<change url="GetBulletinNumbers" before="extraParams.country = App.ComboBox_BulletinCountries.getValue(); extraParams.year=App.ComboBox_BulletinYears.getVal ue(); " success="loadBulletinNumbers">
</change>
</directEvents>
</ext-combobox>
JavaScript Code:
var loadBulletinYears = function (ev, result) {
App.ComboBox_BulletinYears.getStore().setData(resu lt);
}
Sample: file.cshtml
<ext-combobox id="ComboBox_BulletinCountries" editable="false" displayField="Name" valueField="Code" fieldLabel="Pais" flex="1" emptyText="">
<store>
<ext-store data="Model.BulletinCountries" >
<fields>
<ext-numberDataField name="Id" />
<ext-stringDataField name="Code" />
<ext-stringDataField name="Name" />
</fields>
</ext-store>
</store>
<directEvents>
<change url="GetBulletinYears" before="extraParams.country = App.ComboBox_BulletinCountries.getValue();" success="loadBulletinYears">
</change>
</directEvents>
</ext-combobox>
<ext-combobox id="ComboBox_BulletinYears" editable="false" displayField="Year" valueField="Year" fieldLabel="Publicación Año" flex="1" emptyText="">
<store>
<ext-store autoLoad="true">
<fields>
<ext-stringDataField name="Year" />
</fields>
<sorters>
<ext-sorter property="Year" direction="DESC" />
</sorters>
</ext-store>
</store>
<directEvents>
<change url="GetBulletinNumbers" before="extraParams.country = App.ComboBox_BulletinCountries.getValue(); extraParams.year=App.ComboBox_BulletinYears.getVal ue(); " success="loadBulletinNumbers">
</change>
</directEvents>
</ext-combobox>