...
|
...
|
@@ -454,16 +454,16 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table |
|
|
});
|
|
|
table.on("click", "[data-id].btn-change", function (e) {
|
|
|
e.preventDefault();
|
|
|
var switcher = $.proxy(function () {
|
|
|
var changer = $.proxy(function () {
|
|
|
Table.api.multi($(this).data("action") ? $(this).data("action") : '', [$(this).data("id")], table, this);
|
|
|
}, this);
|
|
|
if (typeof $(this).data("confirm") !== 'undefined') {
|
|
|
Layer.confirm($(this).data("confirm"), function (index) {
|
|
|
switcher();
|
|
|
changer();
|
|
|
Layer.close(index);
|
|
|
});
|
|
|
} else {
|
|
|
switcher();
|
|
|
changer();
|
|
|
}
|
|
|
});
|
|
|
table.on("click", "[data-id].btn-edit", function (e) {
|
...
|
...
|
@@ -652,8 +652,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table |
|
|
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[pk] + "' " + (url ? "data-url='" + url + "'" : "") + (confirm ? "data-confirm='" + confirm + "'" : "") + " 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>";
|
|
|
return "<a href='javascript:;' data-toggle='tooltip' title='" + __('Click to toggle') + "' class='btn-change " + (disable ? 'btn disabled no-padding' : '') + "' data-index='" + index + "' data-id='"
|
|
|
+ row[pk] + "' " + (url ? "data-url='" + url + "'" : "") + (confirm ? "data-confirm='" + confirm + "'" : "") + " data-params='" + this.field + "=" + (value == yes ? no : yes) + "'><i class='fa fa-toggle-on text-success text-" + color + " " + (value == yes ? '' : 'fa-flip-horizontal text-gray') + " fa-2x'></i></a>";
|
|
|
},
|
|
|
url: function (value, row, index) {
|
|
|
value = value === null ? '' : value.toString();
|
...
|
...
|
|