[CLOSED] Can't select items from multicombo

  1. #1

    [CLOSED] Can't select items from multicombo

    Hi

    I have a multicombo like the one here is the first example here

    and i bind it in this way



        foreach (DataRow dataRow in x.DefaultView.Table.Rows)
                {
                    this.chkg.Items.Add(
                        new ListItem
                        {
                            Value = dataRow["XId"] + "",
                            Text = dataRow["XName"] + ""
                        });
                }
    What i need to do is to select all the items from the client side when i expand it , here is my code for this part

     <ext:MultiCombo ID="chkg" runat="server" Width="260" >
                    <Listeners>
                        <Expand Handler="checkItems(this , '1,2,3' );" Delay="1000" />
                    </Listeners>
                </ext:MultiCombo>
    //i am using delay here because if the event fire directly we will not find the items intiated in the combobox
    but when i use selectByIndex it's only selecting one item if i selected another one it deselect the first one
    and selectByValue not checking the checkbox
    so all what i need i have the values like "1,2,3" i need to check the items have these values when the combobox is expanded

    thanks in advance


  2. #2

    RE: [CLOSED] Can't select items from multicombo

    Hi,

    Use setValue or selectAll methods
    <%@ 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 id="Head1" runat="server">
        <title>Table Layout - Ext.NET Examples</title>    
        <ext:XScript ID="XScript1" runat="server">
            <script type="text/javascript">
            </script>
        </ext:XScript>
        
        <script runat="server">
            protected void Page_Load(object sender, EventArgs e)
            {
                for (int i = 1; i <= 5; i++ )
                {
                    var item = new Ext.Net.ListItem
                        {
                            Value = i.ToString(),
                            Text = "Item " + i
                        };
                    this.chkg.Items.Add(item);
                    this.chkg2.Items.Add(item);
                }
            }
        </script>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:MultiCombo ID="chkg" runat="server" Width="260" >
                <Listeners>
                    <Expand Handler="this.setValue('1,2,3');"/>
                </Listeners>
            </ext:MultiCombo>
            
            <ext:MultiCombo ID="chkg2" runat="server" Width="260" >
                <Listeners>
                    <Expand Handler="this.selectAll();"/>
                </Listeners>
            </ext:MultiCombo>
        </form>
    </body>
  3. #3

    RE: [CLOSED] Can't select items from multicombo

    Thanks a lot it's working now
  4. #4

    RE: [CLOSED] Can't select items from multicombo

    We've also encountered this bug and worked around it with setValue.
    By the way, this changes seems to fix it:
    Index: Ext.Net/Build/Ext.Net/extnet/core/form/MultiCombo.js
    ===================================================================
    --- Ext.Net/Build/Ext.Net/extnet/core/form/MultiCombo.js        (revision 2855)
    +++ Ext.Net/Build/Ext.Net/extnet/core/form/MultiCombo.js        (working copy)
    @@ -431,7 +431,7 @@
             }
    
             if (this.checkedRecords.indexOf(record) === -1) {
    -            this.checkedRecords.remove(record);
    +            this.checkedRecords.push(record);
                        this.selectRecord(record);
    
                        if (this.store.isFiltered()) {

Similar Threads

  1. Replies: 0
    Last Post: Sep 19, 2011, 11:11 AM
  2. Replies: 11
    Last Post: Mar 27, 2011, 5:26 PM
  3. [CLOSED] MultiCombo doesn't select items with comma in text
    By acrossdev in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Oct 19, 2010, 6:56 AM
  4. [CLOSED] Is it possible to Select Items of a multi select during ajax event
    By vedagopal2004 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 29, 2010, 6:28 PM
  5. Replies: 0
    Last Post: Feb 01, 2010, 12:42 PM

Posting Permissions