Results 1 to 3 of 3

Thread: Add portlets dynamically

  1. #1
    Ext User
    Join Date
    May 2009
    Posts
    5
    Vote Rating
    0
      0  

    Default Add portlets dynamically

    Hi,

    I need to create a new panel and add it to a portlet.

    How do I add it dynamically?

  2. #2
    Sencha User
    Join Date
    Sep 2009
    Location
    Calgary, Alberta, Canada
    Posts
    638
    Vote Rating
    2
      0  

    Lightbulb

    You are going to need to find the location and position that you would like to insert the portlet.

    I essentially took the code from Portal Drag and Drop.

    The portal contains portal columns and then the portlet itself.

    Extending the portal object add the function and call it whenever you need to add the portlet.
    Code:
    addPortlet: function (config) {
    // find the position, and column for the portlet from the config var col = (config.columnIndex == null) ? 0 : (config.columnIndex >= this.items.length) ? this.items.length - 1 : config.columnIndex; var pos = config.position || 0; var c = this.items.itemAt(col); c.insert(pos, config); c.doLayout();
    }

  3. #3
    Ext User
    Join Date
    May 2009
    Posts
    5
    Vote Rating
    0
      0  

    Default worked :)

    Thanks a lot..it worked for me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •