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.
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
#If you have any other info about this subject , Please add it free.# |
- edit