[CLOSED] check all MultiCombo items from javascript

  1. #1

    [CLOSED] check all MultiCombo items from javascript

    Hi,
    Calling the selectAll() method on a MultiCombo in javascript does not work for me anymore. No checkboxes are checked.

    I'm using:
    Browser: IE8
    Ext.NET: 2.2.0.25592 (latest from SVN).

    Thanks,
    Sander

    <%@ Page Language="C#" %>
    
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    <script runat="server">    
        protected void Page_Load(object sender, EventArgs e)
        {
        }
    </script>
    
    
    <!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 id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
    
            <ext:MultiCombo ID="mc" runat="server">
                <Items>
                    <ext:ListItem Value="AAA" />
                    <ext:ListItem Value="BBB" />
                </Items>
                <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>
        </form>
    </body>
    </html>
    Last edited by Daniil; Apr 15, 2013 at 11:56 AM. Reason: [CLOSED]
  2. #2
    Hi Sander,

    Thank you for the report. We are investigating a fix.
  3. #3
    You cannot use setRawValue because if current raw value doesn't equal value from 'getDisplayValue' then multicombo will reparse current value from raw value

    I suggest to override getDisplayValue for particular multicombo by adding custom config
    <CustomConfig>
          <ext:ConfigItem Name="getDisplayValue" Value="getDisplayValue" Mode="Raw" />
    </CustomConfig>
    and use this function
    function getDisplayValue() {
                if(this.valueModels && this.valueModels.length == this.store.getCount()) {
                    return "All are selected";
                }
                else {
                    return Ext.net.MultiCombo.prototype.getDisplayValue.call(this);
                }
            }
    or override getDisplayValue for all multicombo
    Ext.net.MultiCombo.override({
                getDisplayValue : function () {
                    if(this.valueModels && this.valueModels.length == this.store.getCount()) {
                        return "All are selected";
                    }
                    else {
                        return this.callParent(arguments);
                    }
                }
            });
  4. #4
    Thx, the override works for me.

    Just for the info; the code I posted came from an other thread.

    http://forums.ext.net/showthread.php...-in-MultiCombo

    Regards,
    Sander
  5. #5
    Quote Originally Posted by prost View Post
    Just for the info; the code I posted came from an other thread.

    http://forums.ext.net/showthread.php...-in-MultiCombo
    Thank you for the link. In that thread I have posted a link to the current thread to notify others who can be interested in.

    Generally, not everything which works for Ext.NET v1 works for Ext.NET v2.

Similar Threads

  1. MultiCombo not returning any selected items
    By dtamils in forum 1.x Help
    Replies: 3
    Last Post: Feb 27, 2013, 3:56 AM
  2. How to get the changed items in the MultiCombo.
    By ascsolutions in forum 1.x Help
    Replies: 0
    Last Post: Sep 05, 2012, 3:05 PM
  3. [CLOSED] Multicombo Items
    By FAS in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 13, 2012, 7:09 PM
  4. [CLOSED] Multicombo with a lot of items
    By sadaf in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Oct 20, 2011, 1:32 PM
  5. [CLOSED] Can't select items from multicombo
    By webclouder in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 21, 2010, 10:10 AM

Tags for this Thread

Posting Permissions