[CLOSED] Adding Store to Root Level of page in code behind

  1. #1

    [CLOSED] Adding Store to Root Level of page in code behind

    Hello,
    I am creating some controls in code behind such as...
    		public Ext.Net.Container.Builder Browser
    		{
    			get
    			{
    				try
    				{
    					Ext.Net.Container oContainer
    						= new Ext.Net.Container ( )
    						{
    							ItemID
    								= this.Model.UiBrowserId,
    
    							Layout
    								= Ext.Net.LayoutType.Fit.ToString ( ) 
    
    
    						};
    
    					oContainer.Add ( this.BrowserContextMenu );
    
    					oContainer.Add ( this.BrowserTopPanel );
    
    					oContainer.Add ( this.WindowSaveConfiguration );
    
    					return oContainer;
    				}
    				catch ( System.Exception ex )
    				{
    					System.Diagnostics.Debug.Fail ( ex.Message );
    
    					throw ex;
    				}
    			}
    		}
    Now this control is added somewhere down the hierarchy of my code behind controls & I would like to add a Store to the page or to the top level object in code behind. How can I get a reference to the page or the top level object to add my store from code behind?
    Thanks.

    --------------------------------------------------
    Hello,
    I think I figured it out...I just added the Store to the "Bin" folder of the object and it worked.
    Thanks

    ----------------------------------------------------
    Thanks Fabricio...is there a way to check if a store has already been added to the bin folder in code behind? I only want to add the store once, but serveral objects are using the store and need to add it if it does not exist. Thanks.
    Last edited by fabricio.murta; Dec 02, 2016 at 5:24 PM.
  2. #2
    Hello, your top component in the page would be usually the form or a viewport. Just give them an ID and access them directly via their ID. If they are somewhere else (like a master page, or partial view) you will probably need to reach them via "some reflection". For example:

    ViewPort vp = Ext.GetCmp<ViewPort>("ViewPort1");
    You may also want to just make an empty container on the page to serve as a placeholder for components.

    Hope this helps!
    Last edited by fabricio.murta; Dec 02, 2016 at 2:17 PM.
  3. #3
    Hello Emidio!

    It's been some time since we last replied you to this topic and still no feedback from you. Do you still need help on this issue? We're looking forward for your feedback!
    Fabrício Murta
    Developer & Support Expert
  4. #4
    No, it's all good. Thanks.

Similar Threads

  1. [CLOSED] Adding record to store from code behind
    By jstifel in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 26, 2013, 7:22 AM
  2. Replies: 1
    Last Post: Apr 25, 2013, 10:56 PM
  3. TreePanel.Root.Clear() and Status Code: 200
    By Arash in forum 2.x Help
    Replies: 11
    Last Post: Jan 16, 2013, 1:59 PM
  4. Replies: 2
    Last Post: Feb 10, 2009, 7:45 PM
  5. Replies: 1
    Last Post: Feb 10, 2009, 4:23 AM

Posting Permissions