wktd
  • I am creating a custom menu and menuItem to be launched inside a custom widget.

    here is my approach. I basically copied the code from Ext.menu.ColorMenu and modified the ColorItem inside. instead of filling in a ColorPalette, I inserted my own Panel. The panel would use autoLoad to fill itself with content from the server.

    I have been able to get things going and popup the panel, but when loading content, I get a
    this.el has no property. I can see why, since I don't have a applyTo: in the panel.

    Ext.extend(Ext.ux.InsertPanel, Ext.Panel, {
    applyTo: "?",
    autoLoad: {url: "clientsearch.page", scripts: true},

    Since the panel was invoked by MenuItem, I don't have control over what el's are available to attach to panel to. I saw an example which calls
    var el = document.createElement("div"); inside onRender: , but I don't know how to match the autoloaded page onto this generated div, and whether onRender: is the property event handler in which to obtain the el.

    please help out with this.


  • for a while, it show up a tiny, blank panel. now not at all.

    here is the code if it helps.

    Ext.ux.InsertMenu = function(config){
    Ext.ux.InsertMenu.superclass.constructor.call(this , config);
    this.plain = true;
    var ci = new Ext.ux.InsertItem(config);
    this.add(ci);
    this.panel = ci.panel;
    };
    Ext.extend(Ext.ux.InsertMenu, Ext.menu.Menu);

    Ext.ux.InsertItem = function(config){
    Ext.ux.InsertItem.superclass.constructor.call(this , new Ext.ux.InsertPanel(config), config);

    this.panel = this.component;
    };
    Ext.extend(Ext.ux.InsertItem, Ext.menu.Adapter);

    Ext.ux.InsertPanel = function(config){
    Ext.ux.InsertPanel.superclass.constructor.call(thi s, config);
    };
    Ext.extend(Ext.ux.InsertPanel, Ext.Panel, {
    //applyTo: ????
    autoLoad: {url: "clientsearch.page", scripts: true},
    }
    });

    Normally, I could a div on my html page with an id, and in my panel, I declare applyTo: 'id'. In this case, the panel is launched by click on the menu item. I don't know where I have an handle to insert a div with the id.

    Granted, I don't understand everything in this code, but for the moment, I am concentrating on getting the menuItem to display a meaning panel.

    Thanks


  • How did the panel popup if it was not rendered? I think you need to show the whole code.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about when to create div in Panel used as MenuItem , Please add it free.
    • edit