Dynamically loading Store problem at runtime

Page 1 of 2 12 LastLast
  1. #1

    Dynamically loading Store problem at runtime

    I have a DLL to build stores from reflection types and mount grids in runtime.
    So, when i create store occurs an reference error in clientside.

    Uncaught ReferenceError: store_test_Visibilityd790c69ccc974bd89b3fcb590106438f is not defined
    when call this
    .callbackRefreshHandler(
    What can i do to fix this ?

    Thx,

    Marcelo Rosa.
  2. #2
    Hi,

    Could you provide a sample to reproduce the problem?
  3. #3
    I cant create an example in code, but i can show an scenario:

    1. Create store from another project (A).
    2. Add this store in Controls of Page from X.ResourceManager in project (A).
    3. Two cases (i think error occurs in step 3.b.):
    3.a. Add this store in Store from GridPanel in another project (B).
    3.b. Add this store.ID in StoreID from ListFilter in another project (B).
    4. Add GridPanel in Items from FormPanel in another project (C).
    5. Add FormPanel in Items from TabPanel (project C).
    6. Add TabPanel in Items from Panel (project C).
    7. Add Panel in Items from DesktopWindow (project C).
    8. Add DesktopWindow in Controls from Page.
    9 Add Desktop in Controls from Page.

            public static GridFilters GetExtFiltersFromType(Type type, bool local, Perfil perfil)
            {
                       ...
                       Store store = GetStore.GetStoreFromType(property.PropertyType, perfil);
                       //Ext.Net.X.ResourceManager.Page.Controls.Add(store);
                       gridFilters.Controls.Add(store);
                       ((ListFilter)_gridFilter).StoreID = store.ID;
                       ...
             }
    Thx,

    Marcelo Rosa.
  4. #4
    Please try to add the Store into
    this.Form.Controls
    where "this" is a page instance.

    And set up StoreID for the GridPanel as well instead of putting the Store into its Store collection.

    But all the same the scenario should not work, since you can't use the Store for both - GridPanel and its ListFilter.

    ListFilter requires a separate Store or Options to be st up.
  5. #5
    Thanks Daniil,

    I put the store for ListFilter in Form thats work better, but create a new problem.
    The store is referenced before instead.

    ...,store:store_test_Visibility59d13ca3b26d45b788cc9aecaed1ffa6,..
    ...this.store_test_Visibility59d13ca3b26d45b788cc9aecaed1ffa6=new Ext.ux.data.PagingStore...
    I try force the store be instead after, but dont find an away to do this.

    Do u have any idea ?

    [Edit]

    this.store_test_Visibility42646f4247c34276806d1603e5f385d3=new Ext.ux.data.PagingStore({proxyId:\"store_test_Visibility42646f4247c34276806d1603e5f385d3\",autoLoad:true,reader:new Ext.data.JsonReader({fields:[{name:\"Enum\"},{name:\"Value\"}],idProperty:\"Enum\"}),directEventConfig:{},proxy:new Ext.data.PagingMemoryProxy([{\"Enum\":0,\"Value\":\"Shared\"},{\"Enum\":1,\"Value\":\"Exclusive\"},{\"Enum\":2,\"Value\":\"Absolut and Exclusive\"}], false)})new Ext.ToolTip({id:\"cellToolTip_91c276c92aa4406a893ac22e08742a0c
    I think find an way to solved this, but, i find another problem. The JS is generated give a syntax error. The ';' has been lost before new Ext.ToolTip().

    Exclusive\"}], false)})new Ext.ToolTip({id:\"cellToolTip_91c276c92aa4406a893ac22e08742a0c
    Before create the Store, i call Render() and set the Store as a lazy item of the GridPanel.

    Thx for ur attention Daniil
    Last edited by marcelorosait; Feb 07, 2012 at 10:44 PM.
  6. #6
    How do you render the GridPanel?
  7. #7
    Quote Originally Posted by marcelorosait View Post
    I put the store for ListFilter in Form thats work better, but create a new problem.
    The store is referenced before instead.

    ...,store:store_test_Visibility59d13ca3b26d45b788cc9aecaed1ffa6,..
    ...this.store_test_Visibility59d13ca3b26d45b788cc9aecaed1ffa6=new Ext.ux.data.PagingStore...
    I try force the store be instead after, but dont find an away to do this.

    Do u have any idea ?
    Please try to put the Store as the first control and Render immediately.
    this.Form.Controls.AddAt(0, store);
    store.Render();
  8. #8
    Hi Daniil,

    I try ur example but not works, look at error :

    BADRESPONSE: Unexpected token <
    Ext.net.ResourceMgr.load([{url:"/WebResource.axd?d=1UCq7OYEZX2TxTRmt93M3LNnKJwDVAglAD7PLcW5Xh9MoB1w3H5YDkuS2C5NzZxP4ZqpvRKrR41CR3FI__51LS7YFTChw1wmf8xA9yw8-kGR0datSoZatMZAvYPtDug_iY6cxDH8_PS_0Q3A54BiUg2&t=634515162980000000"}], function(){MPro_Acesso_MProMenuLayoutPanelNavigation.setAutoScroll(true);MPro_Acesso_MProMenuLayoutPanelDicas.setAutoScroll(true);MPro_Acesso_MProMenuLayout_Panel_Cadastro.collapse(true);MPro_Acesso_MProMenuLayout_Panel_Cadastro.setAutoScroll(true);MPro_Acesso_MProMenuLayout_Panel_Cadastro.setAutoScroll(true);MPro_Acesso_Cadastro_MProMenuPanel.setTitle(null);store_test_Visibility365544c43c46445fba00603aed9a8d63.callbackRefreshHandler(response, {serviceResponse: {success:true,data:{data:[{"Enum":0,"Value":"Compartilhado"},{"Enum":1,"Value":"Exclusivo"},{"Enum":2,"Value":"Exclusivo e Absoluto"}], total: 0}}}, store_test_Visibility365544c43c46445fba00603aed9a8d63, o.eventType, o.action, o.extraParams);store_test_Tipob275e7feade74f2a9de998de4d013a4e.callbackRefreshHandler(response, {serviceResponse: {success:true,data:{data:[{"Enum":0,"Value":"Comercial"},{"Enum":1,"Value":"Residencial"}], total: 0}}}, store_test_Tipob275e7feade74f2a9de998de4d013a4e, o.eventType, o.action, o.extraParams);Ext.net.ResourceMgr.destroyCmp("store_test_Visibilitycc7f4805dd02489dbea2e8db3212f97c");this.store_test_Visibilitycc7f4805dd02489dbea2e8db3212f97c=new Ext.ux.data.PagingStore({proxyId:"store_test_Visibilitycc7f4805dd02489dbea2e8db3212f97c",autoLoad:true,reader:new Ext.data.JsonReader({fields:[{name:"Enum"},{name:"Value"}],idProperty:"Enum"}),directEventConfig:{},proxy:new Ext.data.PagingMemoryProxy([{"Enum":0,"Value":"Compartilhado"},{"Enum":1,"Value":"Exclusivo"},{"Enum":2,"Value":"Exclusivo e Absoluto"}], false)});store_test_Visibilitycc7f4805dd02489dbea2e8db3212f97c.callbackRefreshHandler(response, {serviceResponse: {success:true,data:{data:[{"Enum":0,"Value":"Compartilhado"},{"Enum":1,"Value":"Exclusivo"},{"Enum":2,"Value":"Exclusivo e Absoluto"}], total: 0}}}, store_test_Visibilitycc7f4805dd02489dbea2e8db3212f97c, o.eventType, o.action, o.extraParams);Ext.net.ResourceMgr.destroyCmp("store_test_Tipoc990672856b0473794b1819bb616d118");this.store_test_Tipoc990672856b0473794b1819bb616d118=new Ext.ux.data.PagingStore({proxyId:"store_test_Tipoc990672856b0473794b1819bb616d118",autoLoad:true,reader:new Ext.data.JsonReader({fields:[{name:"Enum"},{name:"Value"}],idProperty:"Enum"}),directEventConfig:{},proxy:new Ext.data.PagingMemoryProxy([{"Enum":0,"Value":"Comercial"},{"Enum":1,"Value":"Residencial"}], false)});store_test_Tipoc990672856b0473794b1819bb616d118.callbackRefreshHandler(response, {serviceResponse: {success:true,data:{data:[{"Enum":0,"Value":"Comercial"},{"Enum":1,"Value":"Residencial"}], total: 0}}}, store_test_Tipoc990672856b0473794b1819bb616d118, o.eventType, o.action, o.extraParams);MPro_Acesso_Cadastro_Grupo_MProGridPanel1Endereco9a888d59593f4d2fb562c20ae035ae92.setAutoScroll(true);MPro_Acesso_Cadastro_Grupo_MProGridPanel1Endereco9a888d59593f4d2fb562c20ae035ae92.setTitle("Endereço");MPro_Acesso_Cadastro_Grupo_MProGridPanel1Endereco9a888d59593f4d2fb562c20ae035ae92.setTitle("Endereço");Ext.net.ResourceMgr.destroyCmp("MPro_Acesso_Cadastro_Grupo_MProLayout");new Ext.Panel({id:"MPro_Acesso_Cadastro_Grupo_MProLayout",xtype:"panel",items:{xtype:"textfield"},layout:"fit",closable:true});ctl15.addAndDoLayout(MPro_Acesso_Cadastro_Grupo_MProLayout);MPro_Acesso_MProMenuLayoutPanelNavigation.collapse();ctl15.setActiveTab("MPro_Acesso_Cadastro_Grupo_MProLayout");ctl15.resizeTabs=true;});
    I render the GridPanel in codebehind in ajax request.

    Thx Daniil !
  9. #9
    Well, I don't know how all is configured/done on your side.

    The runnable example is really needed to help you.
  10. #10
    The example is my project hehehe, the page is strongly dinamically.
    I think u give me an solution to render the store, but we take another problem. The StoreProxy in ListFilter throw an exception when is called, i think he dont find the store control by ID and return an null object, maybe becouse the ListFilter is rendered.


    Thx for ur attention Daniil.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 4
    Last Post: Feb 01, 2012, 8:37 AM
  2. [CLOSED] Problem loading dynamically user constrols
    By pdcase in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 12, 2012, 6:10 PM
  3. [CLOSED] Is Store Loading Problem
    By jesperhp in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 09, 2011, 9:25 AM
  4. Replies: 7
    Last Post: Jun 03, 2011, 9:18 PM
  5. Two cbx in datagrid, store loading problem ?
    By Jackfr in forum 1.x Help
    Replies: 7
    Last Post: Jul 09, 2009, 10:03 AM

Posting Permissions