Extjs中core包下的domHelper的使用
用Panel來做個實例
(function(){
Ext.onReady(function(){
Ext.create("Ext.panel.Panel",{
title:'my panel',
width:400,
height:300,
id:'panel01',
html:'<p id="pan1">hello world</p>',
renderTo:'myP'
});
Ext.core.DomHelper.append(Ext.get("pan1"),"<h1>wo shi bei zhui jia de</h1>");
Ext.core.DomHelper.applyStyles(Ext.get("pan1"),"color:red");
//遇到一個問題,當執行的時候總是報ext-all.js有錯,不知道怎麼解決
var html = Ext.core.DomHelper.createDom(Ext.get("pan1"),"<h5>ni</h5>");
alert(html);
});
})();