点击新增按钮 不弹出页面 直接新打开一个tab页面
- 单个功能的处理
1
2
3
4
5
6
7
8
9
10// index.js中新增下面代码
index:function(){
...
$('.btn-add').off("click").on('click',function(){
Fast.api.addtabs($.fn.bootstrapTable.defaults.extend.add_url,'新增','fa fa-plus');
return false;
});
// 为表格绑定事件
Table.api.bindevent(table);
}
- 需要全局替换
1
2
3
4
5
6
7
8
9
10
11
12//require-table.js
$(toolbar).on('click', Table.config.addbtn, function () {
var ids = Table.api.selectedids(table);
var url = options.extend.add_url;
if (url.indexOf("{ids}") !== -1) {
url = Table.api.replaceurl(url, {ids: ids.length > 0 ? ids.join(",") : 0}, table);
}
// 只需要把open改成addtabs
//Fast.api.open(url, __('Add'), $(this).data() || {});
Fast.api.addtabs(url, __('Add'), $(this).data() || {});
});