combox's item can not be selected when the selected item is not the first page?

  1. #1

    combox's item can not be selected when the selected item is not the first page?

    combox's item can not be select when the selected item is not the first page?

    below is my testcase:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="TobrosCWT.BasicInfoSetup.WebForm4" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        <script type="text/javascript" runat="server">
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!X.IsAjaxRequest)
                {
                    //tfApAccCode.SelectedItems.Add(new Ext.Net.ListItem("test3", "3"));//it can be selected 
                    tfApAccCode.SelectedItems.Add(new Ext.Net.ListItem("test11", "11"));//it can not be selected? why?
                }
            }
    
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <ext:ResourceManager runat="server"></ext:ResourceManager>
                <ext:ComboBox ID="tfApAccCode" runat="server" FieldLabel="Acccout" TypeAhead="false" EmptyText="Please select..." ForceSelection="true" DisplayField="Cname" ValueField="Ccode" MinChars="1" MatchFieldWidth="false" PageSize="10">
                    <Store>
                        <ext:Store ID="store2" runat="server" IsPagingStore="true" PageSize="10">
                            <Model>
                                <ext:Model ID="Model4" runat="server">
                                    <Fields>
                                        <ext:ModelField Name="Ccode" />
                                        <ext:ModelField Name="Cname" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                            <Parameters>
                                <ext:StoreParameter Name="search" Value="#{tfApAccCode}==null?#{tfApAccCode}:#{tfApAccCode}.getValue()" Mode="Raw"></ext:StoreParameter>
                            </Parameters>
                            <Proxy>
                                <ext:AjaxProxy Url="../BasicInfoAshx/Test.ashx">
                                    <ActionMethods Read="GET" />
                                    <Reader>
                                        <ext:JsonReader Root="data" />
                                    </Reader>
                                </ext:AjaxProxy>
                            </Proxy>
                        </ext:Store>
                    </Store>
                    <ListConfig Width="320" Height="300" ItemSelector=".x-boundlist-item">
                        <Tpl ID="Tpl4" runat="server">
                            <Html>
                                <tpl for=".">
    						                                    <tpl if="[xindex] == 1">
    							                                    <table class="cbStates-list">
    								                                    <tr>
    									                                    <th>AccCode</th>
    									                                    <th>AccName</th>
    								                                    </tr>
    						                                    </tpl>
    						                                    <tr class="x-boundlist-item">
    							                                    <td>{Ccode}</td>
    							                                    <td>{Cname}</td>
    						                                    </tr>
    						                                    <tpl if="[xcount-xindex]==0">
    							                                    </table>
    						                                    </tpl>
    					                                    </tpl>
                            </Html>
                        </Tpl>
                    </ListConfig>
                </ext:ComboBox>
            </div>
        </form>
    </body>
    </html>
    Test.ashx.cs:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Ext.Net;
    
    namespace TobrosCWT.BasicInfoAshx
    {
        /// <summary>
        /// Test 
        /// </summary>
        public class Test : IHttpHandler
        {
    
            public void ProcessRequest(HttpContext context)
            {
                context.Response.ContentType = "application/json";
    
                var requestParams = new StoreRequestParameters(context);
    
                int start = requestParams.Start;
                int limit = requestParams.Limit;
    
                var data = GetAllAsPaging(start, limit);
                var total = 30;
    
                var suppliers = new Paging<customss>(data, total);
    
                context.Response.Write(JSON.Serialize(suppliers));
            }
    
            private List<customss> GetAllAsPaging(int start, int limit)
            {
                List<customss> o = new List<customss>();
                for (int i = 0; i < 30; i++)
                {
                    customss c = new customss();
                    c.Ccode = i.ToString();
                    c.Cname = "test" + i;
                    o.Add(c);
                }
                return o.Skip(start).Take(limit).ToList<customss>();
            }
    
    
            public bool IsReusable
            {
                get
                {
                    return false;
                }
            }
        }
    
        class customss
        {
            public string Ccode;
            public string Cname;
        }
    }
    can anyone help me ? thanks.

    Daniil Do you help me ?thanks I hope you reply .....
    Last edited by sclsch; Apr 24, 2013 at 2:49 AM.

Similar Threads

  1. Replies: 17
    Last Post: Dec 17, 2012, 11:58 AM
  2. Ext.net Combox Selected item.value in Ext2.0
    By OSSAGHO in forum 2.x Help
    Replies: 5
    Last Post: Aug 08, 2012, 11:04 AM
  3. Replies: 0
    Last Post: Sep 19, 2011, 11:11 AM
  4. [CLOSED] Always selected Item is nothing for combobox as menu item
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 04, 2011, 4:51 PM
  5. RadioGroup bug getting the selected item
    By paul-2011 in forum 1.x Help
    Replies: 1
    Last Post: Apr 06, 2011, 2:21 PM

Posting Permissions