store's Reader is used if proxy is undefined

Page 1 of 2 12 LastLast
  1. #1

    store's Reader is used if proxy is undefined

    reader.Root = "data";
    reader.TotalProperty = "total";
    var proxy=new Ext.Net.AjaxProxy();
    proxy.ActionMethods.Read = HttpMethod.POST;
    proxy.Url = this.getProxyUrl();
    proxy.Reader.Add(reader);
    var store=new Ext.Net.Store();
    this.EnsureID();
    store.Model.Add(model);
    store.Proxy.Add(proxy);
  2. #2
    System.Exception: Please define Reader for the Proxy (store's Reader is used if proxy is undefined)
  3. #3
    Any update.
  4. #4
    I am not sure what assistance do you need. Exception text gives clear instruction, define reader in proxy only (if proxy is defined)
  5. #5
    Hi @Vladimir,

    I want to know, how to add reader in Ajaxproxy. Any example.(in Code behind).
    Please provide any example of AjaxProxy.(Code behind)

    Thanks
  6. #6
    You code from the first post has reader adding to the proxy already. Just somewhere you add a proxy to the store directly (to Reader collection of the store). You need avoid it (reader must be added to proxy only)
  7. #7
    Hi,

    Still not found any solution. Please provide any example in code behind.

    Thanks
  8. #8
    Provide your sample raises the exception
  9. #9
    Hi Vladimir,

    Please see the below code

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <%@ Register Namespace="Test" TagPrefix="aa" %>
    <html>
    <head runat="server">
        <title>Listagem</title>
    </head>
    <body>
        <div>
            <ext:ResourceManager runat="server" />
            <%--BODY--%>
            <aa:Combo runat="server" fields="fullName" />
        </div>
    </body>
    </html>

    using System;
    using System.Web;
    using Ext.Net;
    
    namespace Test
    {
        public class Combo : Ext.Net.ComboBox
        {
         
    
            #region Protected Methods
            protected override void OnInit(EventArgs e)
            {
                this.QueryMode = DataLoadMode.Remote;
                this.TriggerAction = TriggerAction.All;
                this.MinChars = 1;
                this.PageSize = 10;
                this.TypeAhead = false;
                this.Editable = true;
                this.ForceSelection = true;
    
                var reader = new Ext.Net.JsonReader();
                var model = new Model();
    
                model.Fields.Add("fullName");
                model.Fields.Add("active", ModelFieldType.Boolean);
                reader.Root = "data";
                reader.TotalProperty = "total";
    
                var proxy = new Ext.Net.AjaxProxy();
                proxy.ActionMethods.Read = HttpMethod.POST;
                proxy.Url = this.getProxyUrl();
    
                var store = new Ext.Net.Store();
                this.EnsureID();
                
                store.WarningOnDirty = false;
                this.Store.Add(store);
    
                store.Model.Add(model);
                store.Reader.Add(reader);
                store.Proxy.Add(proxy);
    
                store.AutoLoad = false;
    
                base.OnInit(e);
            }
    
            protected virtual string getProxyUrl()
            {
                return ("https://examples2.ext.net/examples/Gridpanel/Shared/PlantJsonService.asmx");
            }
            #endregion
        }
    }
    Thanks
  10. #10
    1. You have to add the reader to the proxy instead to the store

    Remove
    store.Reader.Add(reader);
    Add
    proxy.Reader.Add(reader);
    2. Ajax request cannot be cross domain. Url must point to the same domain (page's domain)
Page 1 of 2 12 LastLast

Similar Threads

  1. Sugestion about Ext.net.Store and ur Reader
    By marcelorosait in forum 1.x Help
    Replies: 0
    Last Post: Feb 17, 2012, 6:54 PM
  2. [CLOSED] Reader id issue in Store
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 20, 2011, 12:04 PM
  3. Store.Reader.Count = 1?
    By jsemple in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 23, 2010, 8:05 PM
  4. Serialize needed by Reader of Store only
    By izee in forum 1.x Help
    Replies: 0
    Last Post: May 21, 2009, 2:00 PM
  5. DataBinding GridPanel/Store/Reader
    By nuno_Santos in forum 1.x Help
    Replies: 4
    Last Post: Apr 01, 2009, 2:18 PM

Posting Permissions