ext之创建子节点





Ext JS in Action Chapter 02














Ext.onReady(function() {
var myDiv1 = Ext.get('div1');
myDiv1.setSize(350, 350, {duration: 1, easing:'bounceOut'});
myDiv1.createChild('
Element from a string
');
myDiv1.createChild({
tag : 'div',
html : 'Child from a config object'
});
myDiv1.createChild({
tag : 'div',
id : 'nestedDiv',
style : 'border: 1px dashed; padding: 5px;',
children : {
tag : 'div',
html : '...a nested div',
style : 'color: #EE0000; border: 1px solid'
}
});
myDiv1.insertFirst({
tag : 'div',
html : 'Child inserted as node 0 of myDiv1'
});
myDiv1.createChild({
tag : 'div',
id : 'removeMeLater',
html : 'Child inserted as node 4 of myDiv1'
},myDiv1.dom.childNodes[4]);
});

下创建子节点

你可能感兴趣的:(ext,dom,Ext)