实现jquery EasyUI tabs选项卡关闭图标后加载自定义事件

来源:互联网 发布:淘宝卖玉的哪家好 编辑:程序博客网 时间:2024/06/06 02:59

当关闭tabs选项卡时,底部footer需要通过javascript重新定位calcFooter(),如何实现呢?选项卡上的关闭图标的方法是easyui自带的,calcFooter()写在onClose中不起作用,API中没有关闭后的方法,但有个关闭之前的方法onBeforeClose,在onBeforeClose方法中先实现onClose()方法,再calcFooter(),再return false,这样就达到要的效果

代码如下:

$('#tt').tabs({  onBeforeClose: function(title,index){var target = this;var opts = $(target).tabs('options');opts.onBeforeClose = function(){};  // 允许现在关闭$(target).tabs('close',index);calcFooter();return false;// 阻止关闭  }});

1 0