其他分享
首页 > 其他分享> > uniGUI学习之脱离Delphi直接写ExtJS从入门到精通03自定义函数_调用顺序(47)

uniGUI学习之脱离Delphi直接写ExtJS从入门到精通03自定义函数_调用顺序(47)

作者:互联网

 


自定义函数fn

 

ContractedBlock.gifExpandedBlockStart.gif
<link  rel="stylesheet"  href="theme-gray-all.css">
<script src="ext-all.js" ></script>

        <script type="text/javascript">
Ext.onReady(function(){

    var fn = function(e, el, args) {
        alert("handle1");
        alert(args.testId);
    };

    Ext.get('test').on('click', fn, this, {
        single: true,
        delay: 100,
        testId: 4
    });
});
        </script>

        <button id="test">测试</button>
自定义函数fn

调用顺序

ContractedBlock.gifExpandedBlockStart.gif
<link  rel="stylesheet"  href="theme-gray-all.css">
<script src="ext-all.js" ></script>
    <script type="text/javascript">
Ext.onReady(function(){

    var EXTtest = Ext.get('test');

    EXTtest.on('click', function() {
        alert("handle1");
    });
    EXTtest.on('click', function() {
        alert("handle2");
    });

});
        </script> 
    
        <button id="test">显示</button>  
调用顺序

<button><script>先后顺序问题

ContractedBlock.gifExpandedBlockStart.gif
 <button id="test">显示</button>

   <script type="text/javascript">
var e = document.getElementById("test");
e.onclick = function() {
    alert("handle1");
};
e.onclick = function() {
    alert("handle2");
};
 </script>
《button》《script》先后顺序问题。

标签:function,03,uniGUI,自定义,alert,Ext,EXTtest,fn
来源: https://blog.51cto.com/u_15216366/2969373