[CLOSED] MultiCombo selection via script

  1. #1

    [CLOSED] MultiCombo selection via script

    Hi,

    How must MultiCombo be selected using script code?

    If we use setValue method, text is shown as expected, but no item is checked when combo is expanded:

    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET Examples</title>
    </head>
    <body>
        <ext:resourcemanager runat="server" /> 
        <ext:MultiCombo ID="cmbTest" runat="server" Width="200" FieldLabel="Sample" LabelAlign="Top">
            <Items>
                <ext:ListItem Text="Text 1" Value="1" />
                <ext:ListItem Text="Text 2" Value="2" />
            </Items>    
            <Listeners>
                <AfterRender Handler="cmbTest.setValue(['1', '2']);" />
            </Listeners>        
        </ext:MultiCombo>
    </body>
    </html>
    Thanks.
    Last edited by Daniil; Jul 27, 2012 at 2:09 PM. Reason: [CLOSED]
  2. #2
    Hi,

    We will look at this issue, thanks for the report.
  3. #3
    Hi,

    Fixed in Ext.Net 2.1 (http://svn.ext.net/premium/branches/2.1). Please update and retest
  4. #4
    Thanks,

    We will test it after vacations.
  5. #5
    Hi again,

    Udpdated, tested and working as expected.

    Thanks.
  6. #6
    Thanks for confirmation!
  7. #7
    Hi,

    Seems to be broken again.

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <script runat="server">
            protected void Page_Load(object sender, EventArgs e)
            {
                this.Store1.DataSource = this.Jobs;
                this.Store1.DataBind();
            }
    
            private List<Job> Jobs
            {
                get
                {
                    List<Job> jobs = new List<Job>();
    
                    for (int i = 1; i <= 50; i++)
                    {
                        jobs.Add(new Job(
                                    i,
                                    "Task" + i.ToString(),
                                    DateTime.Today.AddDays(i),
                                    DateTime.Today.AddDays(i + i),
                                    (i % 3 == 0)));
                    }
    
                    return jobs;
                }
            }
    
            public class Job
            {
                public Job(int id, string name, DateTime start, DateTime end, bool completed)
                {
                    this.ID = id;
                    this.Name = name;
                    this.Start = start;
                    this.End = end;
                    this.Completed = completed;
                }
    
                public int ID { get; set; }
                public string Name { get; set; }
                public DateTime Start { get; set; }
                public DateTime End { get; set; }
                public bool Completed { get; set; }
            }
        </script>
        <title>#FF Tweets</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <script type="text/javascript">
            var fnLoad = function () {
                var multiCombo1 = Ext.getCmp('MultiCombo1');
    
                multiCombo1.selectAll();
                var selectedValues = multiCombo1.getValue();
                multiCombo1.setValue(selectedValues);
            };
        </script>
        <ext:MultiCombo ID="MultiCombo1" runat="server" AllowBlank="false" ValueField="ID"
            DisplayField="Name" Width="240" Editable="false" SelectionMode="Checkbox" WrapBySquareBrackets="false">
            <Store>
                <ext:Store runat="server" ID="Store1" AutoLoad="false" WarningOnDirty="false" ShowWarningOnFailure="false"
                    TabIndex="-1" RemoteSort="false">
                    <Model>
                        <ext:Model runat="server" IDProperty="ID">
                            <Fields>
                                <ext:ModelField Name="ID" Type="Int" />
                                <ext:ModelField Name="Name" Type="String" />
                            </Fields>
                        </ext:Model>
                    </Model>
                    <Sorters>
                        <ext:DataSorter Property="Name" Direction="ASC" />
                    </Sorters>
                    <Listeners>
                        <Load Fn="fnLoad" />
                    </Listeners>
                </ext:Store>
            </Store>
        </ext:MultiCombo>
    </body>
    </html>
  8. #8
    Thank you for the repoprt. Fixed in SVN
    By the way, selectAll is enough, you can remove 'setValue' calling

Similar Threads

  1. Replies: 1
    Last Post: Dec 04, 2012, 8:46 AM
  2. Replies: 3
    Last Post: Oct 05, 2012, 11:44 AM
  3. MultiCombo that Remember Selection through page
    By MichaelSogos in forum Examples and Extras
    Replies: 1
    Last Post: Sep 21, 2011, 3:50 PM
  4. [CLOSED] Data selection case sensitive on Store with row selection issue
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Oct 20, 2010, 2:30 PM
  5. Replies: 2
    Last Post: Jul 29, 2009, 1:57 PM

Posting Permissions