Example Ajax Linked Combo don't worked

  1. #1

    Example Ajax Linked Combo don't worked

    https://examples1.ext.net/#/Form/Com...Linked_Combos/
    The second combo have no data after choosing a country.
    I need to know why it don't worked, because I have the similar problem - if I use jsonreader in store, the store are still emply after databind. If I use arrayreader or xmlreader - store have data.
    Thank you.

    UPD The example is working now! Is it my browser problem (opera 10.60)? Ничего не понимаю
    Last edited by vooka; Jul 11, 2010 at 11:35 AM.
  2. #2
    Hi,

    The reader depends from data which you bind
    Please demonstrate your test sample
  3. #3
    Hi, thanks for the response.
    There is my code

    <ext:ResourceManager ID="ResourceManager1" runat="server">
            <Listeners>
                    <DocumentReady Handler="#{store1}.load();" />
                </Listeners> 
            </ext:ResourceManager>
            <ext:store ID="store1" runat="server">
             <Proxy>            
                    <ext:HttpProxy runat="server" Method="POST" Url="WebService1.asmx/GetRec" />
                </Proxy>
           <Reader>       
            <ext:JsonReader >  //////// if I use <ext:XmlReader Record="TTestTbl"> then I get items
                <Fields>
                    <ext:RecordField Name="ID" Type="Int" Mapping="ID"/>
                    <ext:RecordField Name="NAME" Type="String" Mapping="NAME"/>
                </Fields>
            </ext:JsonReader>
        </Reader>        
    </ext:store>
    <ext:combobox ID="cb1" runat="server" StoreID="store1" 
                DisplayField="NAME" 
                ValueField="ID"
                Mode="Local"></ext:combobox>
    webmethod
    [WebMethod]
            public List<TTestTbl> GetRec()
            {
                BLL.TestManager bl = new TestManager();
                List<TTestTbl> l = bl.GetTestList();
                return l;
            }
    Type TTestTbl
        public class TTestTbl
        {
            public TTestTbl() { }
            public int ID { get; set; }
            public string NAME { get; set; }
        }
    There is two record at Table TestTbl ID=1, NAME=test1; ID=2, NAME=test2
    BLToolkit

     public abstract class TestTblAccess : DataAccessor
        {
            [SqlQuery(@"SELECT * FROM TestTbl ORDER BY NAME")]
            public abstract List<TTestTbl> Test(DbManager db);
        }
     public class TestManager
        {
            TestTblAccess Accessor
            {
                get { return TypeAccessor<TestTblAccess>.CreateInstance(); }
            }
    
            public List<TTestTbl> GetTestList()
            {
                DbManager db = BLL_UTILS.CreateDBM("connStr");
                List<TTestTbl> l = new List<TTestTbl>();
                l = Accessor.Test(db);
                return l;
            }
        }
    Last edited by vooka; Jul 11, 2010 at 6:00 PM.
  4. #4
    I solve this problem by adding <ext:JsonReader Root="d"> and <ext:HttpProxy runat="server" Json="true" Method="POST"

    But why doesn't work the same code without WebService?

    <ext:ResourceManager ID="ResourceManager1" runat="server">      
            </ext:ResourceManager>
            <ext:store ID="store1" runat="server" AutoDataBind="true">        
        <Reader>       
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="ID" Type="Int" Mapping="ID"/>
                    <ext:RecordField Name="NAME" Type="String" Mapping="NAME"/>
                </Fields>
            </ext:JsonReader>
        </Reader>        
    </ext:store> 
     <ext:combobox ID="cb1" runat="server" StoreID="store1" 
                DisplayField="NAME" 
                ValueField="ID"
                Mode="Local"></ext:combobox>
    codebehind

    if (!X.IsAjaxRequest)
                { BLL.TestManager bl = new TestManager();
                    List<TTestTbl> l = bl.GetTestList();
                    this.store1.DataSource = l;
                    this.store1.DataBind();
                }
    In this case combobox have no data. Why???

Similar Threads

  1. [CLOSED] Combo linked
    By majunior in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 02, 2011, 12:10 PM
  2. Ajax linked combo box in Grid control
    By vs.mukesh in forum 1.x Help
    Replies: 0
    Last Post: Jul 01, 2010, 10:06 AM
  3. Linked Combo Box Problem
    By ary sucaya in forum 1.x Help
    Replies: 0
    Last Post: Jun 04, 2010, 11:40 AM
  4. Linked Combo Boxes using DataSources
    By rthiney in forum 1.x Help
    Replies: 3
    Last Post: Aug 06, 2009, 12:36 PM
  5. Linked Combo set value Problem
    By sachin.munot in forum 1.x Help
    Replies: 0
    Last Post: May 19, 2009, 2:37 AM

Posting Permissions