Aug 17, 2009, 4:51 AM
[CLOSED] Moving between 2 stores
I have the following page and on it I have a store for the combo and a store for the grid. On the button click I want to remove the selected record from the combos store and add it to the grids store.
I have seen this done with 2 grids but I seem to be unable to get it to work with a combo, can you help please?
<ext:ScriptManager ID="ScriptManager1" runat="server" />
<ext:Store ID="StoreLanguages" runat="server">
<Reader>
<ext:JsonReader ReaderID="AttributeID">
<Fields>
<ext:RecordField Name="AttributeID" />
<ext:RecordField Name="Description" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:Store ID="LanguagesSpokenStore" runat="server">
<Reader>
<ext:JsonReader ReaderID="AttributeID">
<Fields>
<ext:RecordField Name="AttributeID" />
<ext:RecordField Name="Description" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:Panel ID="Panel43" Border="true" runat="server" Height="500">
<Body>
<ext:ComboBox ID="cboLanguages" runat="server" Width="250" HideLabel="true" EmptyText="Select a Language to Add" StoreID="StoreLanguages" ValueField="AttributeID" DisplayField="Description" />
<ext:Button ID="btnInsertLanguage" runat="server" Text="Add Language" Icon="Add">
</ext:Button>
<ext:GridPanel ID="grdLanguages" runat="server" Title="" StoreID="LanguagesSpokenStore"
StripeRows="true" EnableViewState="true" Width="395" Height="130" StyleSpec="paddingBottom:3px">
<ColumnModel>
<Columns>
<ext:Column DataIndex="AttributeID" Header="AttributeID" Width="30" />
<ext:Column DataIndex="Description" Header="Language Spoken" Width="280" />
<ext:ImageCommandColumn Width="25" ColumnID="CommandView">
<Commands>
<ext:ImageCommand CommandName="Delete" Icon="BulletCross" Text="">
<ToolTip Text="Remove this Language" />
</ext:ImageCommand>
</Commands>
</ext:ImageCommandColumn>
</Columns>
</ColumnModel>
<Buttons>
</Buttons>
</ext:GridPanel>
</Body>
</ext:Panel>