[CLOSED] "Select All" option in MultiCombo

  1. #1

    [CLOSED] "Select All" option in MultiCombo

    Is there a way to have a select all item in a multicombo to select all items and either display some generic text when selected rather than displaying all selected items with comma seperation?
    Last edited by Daniil; Dec 16, 2011 at 6:26 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I can recommend to use an additional trigger. Here is the example. You might need to set up a respective IconCls.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            
            <ext:MultiCombo ID="MultiCombo1" runat="server" Width="260">
                <Items>
                    <ext:ListItem Text="Item 1" Value="1" />
                    <ext:ListItem Text="Item 2" Value="2" />
                    <ext:ListItem Text="Item 3" Value="3" />
                    <ext:ListItem Text="Item 4" Value="4" />
                    <ext:ListItem Text="Item 5" Value="5" />
                </Items>
                
                <SelectedItems>
                    <ext:SelectedListItem Value="2" />
                    <ext:SelectedListItem Index="4" />
                </SelectedItems>
    
                <Triggers>
                    <ext:FieldTrigger Tag="selectAll" Icon="SimplePlus" Qtip="Select all"  />
                </Triggers>
    
                <Listeners>
                    <TriggerClick Handler="if (tag === 'selectAll') {
                                               this.selectAll();
                                               this.setRawValue('All are selected');
                                           }" />
                </Listeners>
            </ext:MultiCombo>
    
            <ext:Button runat="server" Text="Get value">
                <Listeners>
                    <Click Handler="alert(Ext.encode(MultiCombo1.getValue()));" />
                </Listeners>
            </ext:Button>
        </form>
    </body>
    </html>
  3. #3
    Excellent, works like a charm. Thanks.
  4. #4
    A solution for Ext.NET v2 will differ. Here is a related thread.
    http://forums.ext.net/showthread.php?24368
    Last edited by Baidaly; Oct 31, 2013 at 9:13 PM.
  5. #5

    Correct link

    Just a note for anyone who comes across this looking for a way to make this work in v2-- I think you meant to link to this thread:
    http://forums.ext.net/showthread.php...rom-javascript


    Quote Originally Posted by Daniil View Post
    A solution for Ext.NET v2 will differ. Here is a related thread.
    http://forums.ext.net/showthread.php?16616
  6. #6
    Thank you! The post has been updated.

Similar Threads

  1. [CLOSED] How does "MaskCls" work for "AutoLoad" mask in panel control
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 19, 2012, 12:09 PM
  2. Replies: 1
    Last Post: Jun 26, 2012, 11:29 AM
  3. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  4. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM
  5. Replies: 0
    Last Post: Mar 24, 2011, 2:20 PM

Posting Permissions