View Full Version : How to Create a Window Component with existing HTML elements

22 Oct 2012, 4:08 AM
I build a html form with some custom events a few days before.Now i want to show this form with a Ext Window component.How?

22 Oct 2012, 8:40 AM
To show HTML in a window, you could use the following:

Ext.onReady(function() {
myPanel = Ext.create('Ext.Panel', {
width: 300,
height: 150,
title: 'Title',
layout: 'vbox',
frame: true,
renderTo: Ext.getBody(),
items: [
xtype: 'button',
text: 'Click to open HTML window',
handler: function(b, e) {
var myWin = Ext.create("Ext.window.Window", {
title: 'HTML Window',
modal: true,
html: '<iframe src="http://www.sencha.com" width="100%" height="100%" ></iframe>',
width: 700,
height: 500



22 Oct 2012, 6:39 PM
Thanks.but i want to nest a existing dom element in Ext.window.Window,like this:
Ext.onReady(function() { var form = Ext.get("formPanel"); //get Ext.dom.Element of formPanel.i add some custom events to this dom var win = Ext.create("Ext.window.Window", { width:300, height: 400, title:"Title" }); //then do something nest form in win});How to do??