Using Filter on a MultiSelect - Selection is cleared on Filter...

  1. #1

    Using Filter on a MultiSelect - Selection is cleared on Filter...

    Hi,
    Whenever the filter is changed or cleared any selected items are cleared. Is there any way to keep the selections while filtering???


    Click image for larger version. 

Name:	Using Filter on a MultiSelect.JPG 
Views:	190 
Size:	52.1 KB 
ID:	3946
  2. #2

    Solved !!!

    I fould my solution:

    .aspx
                                             <ext:MultiSelect ID="lstProducts" runat="server" Height="130" Width="250" DisplayField="DisplayProductCode"
                                                                Note="<span Style='font-size: x-small'>Select nothing to include all Products</span>"
                                                                ValueField="ProductId" StoreID="ProductsStore" AutoDataBind="true">
                                                                <TopBar>
                                                                    <ext:Toolbar runat="server">
                                                                        <Items>
                                                                            <ext:ToolbarTextItem runat="server" Text="Find:" />
                                                                            <ext:TriggerField ID="productFilterField" runat="server" EnableKeyEvents="true">
                                                                                <Triggers>
                                                                                    <ext:FieldTrigger Icon="Clear" Qtip="Clear filter" />
                                                                                </Triggers>
                                                                                <Listeners>
                                                                                    <KeyUp Fn="keyUpProductHandler" />
                                                                                    <TriggerClick Handler="clearProductFilter();" />
                                                                                </Listeners>
                                                                            </ext:TriggerField>
                                                                        </Items>
                                                                    </ext:Toolbar>
                                                                </TopBar>
                                                                <AjaxEvents>
                                                                    <Click OnEvent="lstProducts_Click" Method="POST" Type="Load" />
                                                                </AjaxEvents>
                                                            </ext:MultiSelect>

    .js
    // *********************************** Product Filtering ***********************************
    var keyUpProductHandler = function(field, e) {
        //lstProducts.view.clearSelections();
        var items = lstProducts.store.data.items,
                    value = field.getValue(),
                    i;
        for (i = 0; i < items.length; i++) {
            str = items[i].data.DisplayProductCode.trim().toLowerCase();
            if (str.match(value.toLowerCase()) == value.toLowerCase()) {
                break;
            }
        }
    
        if(i < items.length)
            if (lstProducts.view.getNode(i) != 'undefined') {
                lstProducts.view.getNode(i).scrollIntoView();
                //lstProducts.view.select(i);
            }
        }
    
        var clearProductFilter = function() {
            productFilterField.reset();
        }

Similar Threads

  1. Remote filter for Header Filter
    By huzzy143 in forum 1.x Help
    Replies: 2
    Last Post: May 09, 2012, 3:43 PM
  2. Replies: 2
    Last Post: May 01, 2012, 4:57 PM
  3. Filter example
    By exown in forum 1.x Help
    Replies: 1
    Last Post: May 12, 2011, 11:23 PM
  4. [CLOSED] Missing filter column using MultiHeader Filter.
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 12, 2010, 1:07 PM
  5. MultiHeader - Filter
    By mono in forum 1.x Help
    Replies: 4
    Last Post: Apr 22, 2009, 8:13 AM

Tags for this Thread

Posting Permissions