[CLOSED] Problem to create a store in code behind.

  1. #1

    [CLOSED] Problem to create a store in code behind.

    Hello

    I will try to create code behind control with tab, panel grid...and a store for the grid.

    All works fine until I came to the store.

    I inspire mysel from the Ext.Net book and use a .ashx page to create all the mess.

    Problem is my store came back from server with a memory proxy.

    Here how I create the store:

                   Dim ProxyConfig As New AjaxProxy.Config
    
                    Dim ReaderStatus As New JsonReader
                    With ReaderStatus
                        .Root = "data"
                    End With
                    With ProxyConfig
                        .Url = "jsonDAL/returnJSONHistoriqueStatus.aspx?RMA=" + STR_RMA
                        .Timeout = 300000000
                        .Reader.Add(ReaderStatus)
                    End With
                    Dim StoreStatus As New Store
                    Dim ProxyStatus As AjaxProxy = New AjaxProxy(ProxyConfig)
                    Dim ModelFieldStatus As New Model
    
                    ModelFieldStatus.Name = "Model_" + STR_RMA
                    ModelFieldStatus.Fields.Add("STR_Title")
                    ModelFieldStatus.Fields.Add("STR_Status")
                    ModelFieldStatus.Fields.Add("STR_Tech")
                    ModelFieldStatus.Fields.Add("STR_DateMajStatus")
                    ModelFieldStatus.Fields.Add("STR_Comment")
    
                    With StoreStatus
                        .ID = "Store_" + STR_RMA
                        .Model.Add(ModelFieldStatus)
                        .SetProxy(ProxyStatus)
                    End With
    And here what I get from server (only the store definition here):
    {store:
        {model:Ext.define("Model_33841", 
            {extend: "Ext.data.Model", 
            fields:[{name:"STR_Title"},
                    {name:"STR_Status"},
                    {name:"STR_Tech"},
                    {name:"STR_DateMajStatus"},
                    {name:"STR_Comment"}] }),
            storeId:"Store_33841",
            autoLoad:true,
            proxy:{type:'memory'}
        }
    }
    What I miis on that?
    Last edited by Daniil; Jan 24, 2013 at 9:18 AM. Reason: [CLOSED]
  2. #2
    Hi @feanor91,

    Please try:
    .Proxy.Add(ProxyStatus)
    instead of
    .SetProxy(ProxyStatus)
    The SetProxy is a method for already a rendered Store.
  3. #3
    You'r a king man, it works very well, thanks

Similar Threads

  1. Create TreeGrid in code behind
    By milenios in forum 2.x Help
    Replies: 0
    Last Post: Jul 26, 2012, 10:06 PM
  2. [CLOSED] Problem to get store from code behind
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 27, 2012, 1:32 PM
  3. Replies: 3
    Last Post: Jul 24, 2011, 1:57 PM
  4. Create controls in code behind
    By Yannis in forum 1.x Help
    Replies: 1
    Last Post: Nov 26, 2009, 12:03 AM
  5. Replies: 1
    Last Post: Aug 12, 2009, 11:39 AM

Posting Permissions