multiple instances of the same panel

  1. #1

    multiple instances of the same panel type

    Hello:

    I want to define a panel as a type and I want to create two instances of this panel, one in a window and one in a normal panel. What is the best way to achieve this with ext.net?

    What about duplicate ids?

    In pure extjs I would have something like this:
    EditPanel = Ext.extend(Ext.Panel, {
        title: 'My Panel',
        width: 523,
        height: 384,
        initComponent: function() {
            this.tbar = {
                xtype: 'toolbar',
                items: [
                    {
                        xtype: 'button',
                        text: 'MyButton'
                    }
                ]
            };
            EditPanel.superclass.initComponent.call(this);
        }
    });
    
    var myEditPanel1 = new EditPanel();
    var myEditPanel2 = new EditPanel();
    Thank you
    Last edited by costab; May 28, 2011 at 8:08 PM.
  2. #2
    Hi,

    Id must be unique. You can pass it through a component's config.
    var myEditPanel1 = new EditPanel({ id: 'someId' });
  3. #3
    Hi:

    My question was more about the ability to define panels as "classes" and instantiate them, and what is the best way to achieve that in ext.net.

    I tried to use asp.net user controls and to use the <Content></Content> property to add different instances of a control but I had problems with the rendering. The border layout panels were not rendered properly.

    Another way that I could think of is to define the shared panels in code.

    But is there another way in ext.net?

    Thanks
    Last edited by costab; May 30, 2011 at 4:18 PM.
  4. #4
    You can just extend Ext.Net.Panel class.
    class MyPanel : Ext.Net.Panel {
       ...
    }
    and instantiate it in code behind like other controls.

Similar Threads

  1. Replies: 5
    Last Post: Apr 16, 2012, 9:17 PM
  2. Multiple Row Selection Grid Panel with out ctrl key
    By AnandVishnu in forum 1.x Help
    Replies: 2
    Last Post: Oct 03, 2011, 10:08 AM
  3. [CLOSED] ids and multiple instances of the same UI
    By PLoch in forum 1.x Premium Help
    Replies: 2
    Last Post: Jul 28, 2011, 9:44 PM
  4. [CLOSED] Multiple Editors - Multiple Instances?
    By jwf in forum 1.x Premium Help
    Replies: 5
    Last Post: Jun 09, 2011, 5:45 PM
  5. Replies: 2
    Last Post: Jun 19, 2009, 2:49 PM

Posting Permissions