Jul 22, 2009, 9:41 AM
Remove signle selected item from MultiSelect on client
How can I remove a selected item from a Multiselect in javascript? I'd like to be able to click the btnDeleteLink.
Right now, I'm just clearing out the entire thing...
My multiselect is bound to a store:
The Store:
Right now, I'm just clearing out the entire thing...
My multiselect is bound to a store:
The Store:
<ext:Store ID="selectedColumns" runat="server" AutoDataBind="true" AutoLoad="true">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="text" Type="String" />
<ext:RecordField Name="value" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
The Multiselect: <ext:MultiSelect ID="MultiSelect1" StoreID="selectedColumns" DragGroup="grp1" DropGroup="grp1" fieldlabel="Entity Links" displayfield="text" ValueField="value" runat="server" Width="564" Height="150" KeepSelectiononclick="WithCtrlKey">
<Items>
</Items>
<Listeners>
<BeforeStateSave handler="alert('state save');" />
</Listeners>
<BottomBar>
<ext:Toolbar runat="server" id="ToolbarMulti">
<Items>
<ext:Button runat="server" id="btnDeleteLink" text="Delete" icon="decline">
<Listeners>
<Click handler="#{MultiSelect1}.reset();#{MultiSelect1}.clear(); #{hidLinkIds}.setValue('');" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</BottomBar>
</ext:MultiSelect>