[CLOSED] Rest proxy load and autoload

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Rest proxy load and autoload

    Hey guys.

    i have a question, why is it that when you put a rest / ajax proxy on a datastore it will call store load before after render..?

    i know that a proxy will call the url specified when the grid is being initialized, but is there no way to control when the read method should be called..?

    suppose i have to call store.load after my grid has put in the ui tree, thous needing the gridID after it has been created since i cant retrive the grid on its ID before it has been created.

    my datastore is set to autoload = false. so in teory the store should not load until my method is being called..

    does anybody know if the flow for a proxy differs for a datastore so you dont have any control over when you call store.load()..?

    Ex.

    this should be call as the first method before my proxy read is called
    
    LIA.Administration.grid.AfterRender = function (grid) {
        grid.getStore().load();
    }
    this is called insted af the method above and as a result the grid variable is null..
    
    LIA.grid.gridGetKeyValuesSingle = function (grid) {
        var tGrid = Ext.getCmp(grid);
        if (tGrid == null) return {};
        if (tGrid.keyValues != undefined) {
            return tGrid.keyValues;
        }
    
        return {};
    };
    Datastore Initialization
    public void BuildStore(bool isPaging)
            {
                var pageSize = 50;
                this.dataStore = new Store()
                {
                    ID = this.ID + "_store",
                    IsPagingStore = isPaging,
                    PageSize = pageSize,
                    AutoDestroy = true,
                    RemoteFilter = true,
                    RemoteSort = true,
                    RemotePaging = true,
                    AutoSync = false,
                    Model =
                    {
                        new Model()
                        {
                            IDProperty = ""
                        }
                    },
                };
                this.Store.Add(dataStore);
            }
    Rest Proxy initialization
    
    public void BuildProxy()
            {
                this.proxy = new AjaxProxy();
                JsonReader reader = new JsonReader()
                {
                    Root = "rows",
                    TotalProperty = "totalCount",
                   // IDProperty = "ID",
                    SuccessProperty = "success",
                    MessageProperty = "message",
                };
                JsonWriter writer = new JsonWriter()
                {
                    WriteAllFields = true,
                    Encode = true,
                    Root = "rows",
                };
                proxy.Reader.Add(reader);
                proxy.Writer.Add(writer);
                this.dataStore.Proxy.Add(proxy);
            }
    "proxy" is the variable for my datastores Rest proxy
    
     public void SetReadMethod(object bClass, String method)
            {
                this.proxy.API.Read = LiaMethod.GetDirectMethod(bClass, method);
                this.proxy.ExtraParams.Add(new Parameter("keys", "LIA.grid.gridGetKeyValuesSingle ('" + this.ID + "')", ParameterMode.Raw));
    
            }
    Best regard

    Akpenob..
    Last edited by Daniil; Nov 06, 2012 at 5:51 AM. Reason: [CLOSED]

Similar Threads

  1. [CLOSED] Load data to store of combobox by proxy
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 08, 2012, 8:29 AM
  2. Replies: 13
    Last Post: Sep 07, 2012, 6:23 PM
  3. [CLOSED] Avoid Store Autoload on HTTP Proxy
    By dev in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 12, 2011, 2:39 PM
  4. autoload datastore records from http proxy
    By hnafar in forum 1.x Help
    Replies: 1
    Last Post: Feb 11, 2010, 7:50 AM
  5. How to load PDF document in AutoLoad?
    By dbassett74 in forum 1.x Help
    Replies: 1
    Last Post: May 14, 2009, 5:30 PM

Tags for this Thread

Posting Permissions