extjs笔记(一) ext.onready()用法

时间:2014-05-26 08:39:40   收藏:0   阅读:300

定义:加载完ExtJs库之后,开始加载OnReady中指定的函数

参数:onReady( fn, scope, options )

  1. fn回调函数 表示要执行的函数
  2. scope表示函数的作用域
  3. 表示函数执行的一些其它特性,比如延迟多少毫秒执行等,大多数情况下只需要第一个参数即可。

事例探究一:加载方法的作用

bubuko.com,布布扣
a.

function a(){

     alert("every thing is OK!")

}

Ext.onReady(a);

 

b.

Ext.onReady(function(){

     alert("every thing is OK!");

});
bubuko.com,布布扣

 

结果打印MsgBox框:every thing is OK!

事例探究二:参数解释

bubuko.com,布布扣
<script type="text/javascript">

     var b1={v:"this id b1"};

     var b2={v:"this id b2"};

     function b(){

         alert(this.v);

     }

     Ext.onReady(b,b1,{dealy:"50000000"});

     Ext.onReady(b,b2,{dealy:"50000000"}); 

</script>
bubuko.com,布布扣

 

extjs笔记(一) ext.onready()用法,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!