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);
});
})();
本文介绍了在Extjs中利用core包下的domHelper进行DOM操作的实例,包括创建Panel面板、追加元素、应用样式等,并解决在执行过程中遇到的ext-all.js错误问题。

被折叠的 条评论
为什么被折叠?



