Extjs4.0中core包下的domHelper的使用

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);

});

})();

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章