-
方式一:
<script>
Ext.onReady(function(){
alert('onready');
});
</script>
最简单了,最平常的调用,不用多说
- 方式二:
<script>
Ext.color=function(){return{
init:function(){
alert("init")
}
}
}();
Ext.onReady(Ext.color.init,Ext.color);
</script>
通过onReady调用color函数,init为color中的内置,作用是初始化.这种写法比较实用
- 方式三:
<script>
Ext.onReady(function(){
alert('onready');
});
Ext.color=function(){
return{
init:function(){
alert("init")
}
}
}();
Ext.onReady(Ext.color.init,Ext.color);
</script>
这种是混合型写法,两个onReady都会被调用,调用顺序是看谁在前面.
本文介绍了 ExtJS 中 onReady 方法的三种使用方式,包括基本用法、通过自定义函数初始化的方法以及混合使用的方式,并解释了这些方法的区别及应用场景。
1719

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



