PDA

View Full Version : autocreate all html-elements



manfed
29 Apr 2007, 6:28 AM
How can i make a completely html-free program with ext?
Means all htmlelements are autocreated.

I want avoid things, like this:
new Ext.BorderLayout( Ext.DomHelper.append( document.body, { tag : 'div' } ) , { .. } ) );
or
new Ext.Toolbar( Ext.DomHelper.append( document.body, { tag : 'div' } ) );

dfenwick
29 Apr 2007, 2:42 PM
How can i make a completely html-free program with ext?
Means all htmlelements are autocreated.

I want avoid things, like this:
new Ext.BorderLayout( Ext.DomHelper.append( document.body, { tag : 'div' } ) , { .. } ) );
or
new Ext.Toolbar( Ext.DomHelper.append( document.body, { tag : 'div' } ) );

With BorderLayout, unless you're rendering to document.body, you will have to create an element for the layout. You can pass autoCreate: true to your configuration object when building ContentPanel objects. With Toolbar, you're going to have to create a DOM element to contain the toolbar. In the end, though, there will be lots of DOM elements being created by Ext. It's how the browser works.

Why are you avoiding creating HTML elements?