Mar 09, 2012, 5:17 PM
[CLOSED] ComboBox didn't sync store's change
Hi:
I have two ComboBoxs which name "parent" and "child".
the parent ComboBox is:
When I select the second item in parent ComboBox, the child ComboBox change the text in text field but when I drill down the drop box, the item is still the old items. I checked the store. The store is filter correctly, I can see the items in store changed.
if I select the second item in parent ComboBox again, the child ComboBox's drop down item then updated correctly.
I am really don't understand what's going on now. Could you help me out?
Thank you
I have two ComboBoxs which name "parent" and "child".
the parent ComboBox is:
<ext:ComboBox ID="parent" runat="server" SelectedIndex="0" Editable="false" TabIndex="1" AutoFocusDelay="50" AutoFocus="True">
<Items>
<ext:ListItem Text="<%$Resources: Strings, CoreTaskWorkIn%>" Value="ct" />
<ext:ListItem Text="<%$Resources: Strings, DivertedTasks%>" Value="dt" />
<ext:ListItem Text="<%$Resources: Strings, Downtimes%>" Value="dn" />
<ext:ListItem Text="<%$Resources: Strings, Resources%>" Value="rs" />
<ext:ListItem Text="<%$Resources: Strings, Productivity%>" Value="pr" />
</Items>
<Listeners>
<Select Fn="taskTypeItemChange" Delay="1"></Select>
</Listeners>
</ext:ComboBox>
the child ComboBox is:<ext:ComboBox ID="child" runat="server" SelectedIndex="0" Editable="false"
StoreID="StoreTaskItemList" DisplayField="Name" ValueField="Id" TabIndex="2" TypeAhead="True"
TriggerAction="All">
<Listeners>
<Select Fn="forecast.taskItemChange" Delay="1"></Select>
</Listeners>
</ext:ComboBox>
the taskTypeItemChange is:taskTypeItemChange: function (item, leaveForecsting) {
StoreTaskItemList.filter({ property: 'TaskType', value: item.getValue() });
child.setValue(StoreTaskItemList.getAt(0).get('Id'));
child.selectedIndex = 0;
}
When the page load everything is fine. I can see the child ComboBox bind the correct item.When I select the second item in parent ComboBox, the child ComboBox change the text in text field but when I drill down the drop box, the item is still the old items. I checked the store. The store is filter correctly, I can see the items in store changed.
if I select the second item in parent ComboBox again, the child ComboBox's drop down item then updated correctly.
I am really don't understand what's going on now. Could you help me out?
Thank you
Last edited by Daniil; Mar 12, 2012 at 11:58 AM.
Reason: [CLOSED]