|
|
@@ -485,7 +485,11 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
|
|
var yes = typeof this.yes !== 'undefined' ? this.yes : 1;
|
|
|
var no = typeof this.no !== 'undefined' ? this.no : 0;
|
|
|
var url = typeof this.url !== 'undefined' ? this.url : '';
|
|
|
- return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change' data-id='"
|
|
|
+ var disable = false;
|
|
|
+ if (typeof this.disable !== "undefined") {
|
|
|
+ disable = typeof this.disable === "function" ? this.disable.call(this, value, row, index) : this.disable;
|
|
|
+ }
|
|
|
+ return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change " + (disable ? 'btn disabled' : '') + "' data-id='"
|
|
|
+ row.id + "' " + (url ? "data-url='" + url + "'" : "") + " data-params='" + this.field + "=" + (value == yes ? no : yes) + "'><i class='fa fa-toggle-on " + (value == yes ? 'text-' + color : 'fa-flip-horizontal text-gray') + " fa-2x'></i></a>";
|
|
|
},
|
|
|
url: function (value, row, index) {
|
|
|
@@ -638,7 +642,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
|
|
text = typeof j.text === 'function' ? j.text.call(table, row, j) : j.text ? j.text : '';
|
|
|
title = typeof j.title === 'function' ? j.title.call(table, row, j) : j.title ? j.title : text;
|
|
|
refresh = j.refresh ? 'data-refresh="' + j.refresh + '"' : '';
|
|
|
- confirm = j.confirm ? 'data-confirm="' + j.confirm + '"' : '';
|
|
|
+ confirm = typeof j.confirm === 'function' ? j.confirm.call(table, row, j) : (typeof j.confirm !== 'undefined' ? j.disable : false);
|
|
|
+ confirm = confirm ? 'data-confirm="' + confirm + '"' : '';
|
|
|
extend = j.extend ? j.extend : '';
|
|
|
disable = typeof j.disable === 'function' ? j.disable.call(table, row, j) : (typeof j.disable !== 'undefined' ? j.disable : false);
|
|
|
if (disable) {
|