PDA

View Full Version : Extend a window from a FormPanel instead of Panel



dersgniw
4 Sep 2013, 12:07 PM
Ext.Window is currently extended from a standard Ext.Panel. I would like to extend the Ext.FormPanel features into a window. I'm wondering if there is any simple way to do this.

I've attempted a few things using Ext.extend, thinking this would simply overwrite the methods. I'm apparently wrong.

The closest seemed to be this:
var formPanelWindow = Ext.extend(Ext.FormPanel, Ext.Window.prototype) //Not using prototype didn't work.

However, this also somehow overrides the Ext.Window.

So, is there any way to get FormPanel feature extended into an new class based on Ext.Window

slemmon
6 Sep 2013, 7:33 AM
You could copy the source for Window, give Ext.Window a new name of Ext.FormWindow, and have it extend FormPanel instead of Panel.

Though, I suspect if it were me I'd just have a Window with a single Child item of FormPanel in a fit layout and be done.

dersgniw
6 Sep 2013, 8:23 AM
Thanks for the input. I just thought there might be some easy workaround to do this. I figured the standard way was simply a FormPanel inside a Window.. but was hoping to save a little DOM work.. and some cleverness!