EasyUI onSelect方法

部分组件的onSelect方法会在onLoad后直接触发,如果onSelect自定义了回调函数或其他设置,则可能受第一次的影响。如果希望屏蔽第一次触发的影响,可以使用这种方法。

 

下面是一个tabs

var firstSelect=true; // 使用一个变量在判断是不是第一次

$('#conceptDetailTab').tabs({
    onSelect:function(title,index){
    // 写需要运行的代码
if(!firstSelect){ tagIndex=index; console.info(tagIndex); }
    // 然后将firstSelect设为false,表示已经运行过第一次了
if(firstSelect){ firstSelect=false; } } });

 

posted @ 2015-12-27 17:57  puladiao  阅读(4716)  评论(0编辑  收藏  举报