PDA

View Full Version : [CLOSED] extjs store add data auto clear



siyahgul
Jun 24, 2015, 10:57 PM
hi.



<ext:ResourceManager runat="server" />

<ext:Store runat="server" ID="store1" AutoLoad="false">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="grup" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>

<ext:Panel runat="server">
<Items>
<ext:Button runat="server" Text="Add data">
<Listeners>
<Click Handler="
var store = App.store1;
store.add({grup : 'test1'});
store.add({grup : 'test2'});
store.add({grup : 'test3'});
" />
</Listeners>
</ext:Button>
<ext:GridPanel runat="server" StoreID="store1">
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="grup" DataIndex="grup" Flex="1" />
</Columns>
</ColumnModel>
</ext:GridPanel>
<ext:ComboBox runat="server" StoreID="store1" ValueField="grup" DisplayField="grup" />
</Items>
</ext:Panel>


first step, I press the add data button. second step, I open the ComboBox. Deleting data.

Daniil
Jun 25, 2015, 9:31 AM
Hi @siyahgul,

Please set QueryMode="Local" for the ComboBox.

siyahgul
Jun 25, 2015, 11:24 PM
thank you.