[CLOSED] Adding Portlet Dynamically JavaScript

  1. #1

    [CLOSED] Adding Portlet Dynamically JavaScript

    Is there any way to add portlets dynamically in javascript? I see it has an xtype of 'portlet', but when I try it simply doesn't show up:

    var addNewPortlet = function () {
        return new Ext.Component({
            xtype: 'portlet',
            title: 'Test',
            width: 100,
            heigh: 100
        });
    };
    
    ....
    
        for (var i = 0; i < records.length; i++) {
            portalColumn.items.add(addNewPortlet());
        }
        portalMain.doLayout();
    Last edited by Daniil; Feb 21, 2012 at 7:42 PM. Reason: [CLOSED]
  2. #2
    Hi,

    The "xtype" config option is used for lazy items only.

    When you create a component using its container, "xtype" is ignored.

    Please use:
    return new Ext.ux.Portlet({ ... });
    Also this is not enough to just populate the portalColumn's items collection to add a portlet on the fly.

    Please use:
    portalColumn.add(new Ext.ux.Portlet({ ... }););
  3. #3
    Here is a related Ext.NET v2.x thread.
    http://forums.ext.net/showthread.php?36351

Similar Threads

  1. Replies: 5
    Last Post: Jan 06, 2010, 11:35 AM
  2. Replies: 1
    Last Post: Nov 25, 2009, 5:23 AM
  3. Create portlet dynamically
    By vimaln in forum 1.x Help
    Replies: 3
    Last Post: Mar 13, 2009, 8:59 PM
  4. Trouble adding portlet from code behind
    By cmschick in forum 1.x Help
    Replies: 0
    Last Post: Feb 16, 2009, 9:21 AM
  5. How to Create a portlet dynamically?
    By mohan.kantipudi in forum 1.x Help
    Replies: 0
    Last Post: Jan 16, 2009, 3:11 AM

Posting Permissions