[Update] 优化资产选择 (#2267)

* [Update] 优化资产选择

* [Update] 优化资产任务
This commit is contained in:
老广
2018-12-25 13:33:37 +08:00
committed by GitHub
parent dab692c0eb
commit a990098744
9 changed files with 77 additions and 6 deletions

View File

@@ -528,6 +528,7 @@ jumpserver.initServerSideDataTable = function (options) {
lengthMenu: [[10, 15, 25, 50], [10, 15, 25, 50]]
});
table.selected = [];
table.selected_rows = [];
table.on('select', function(e, dt, type, indexes) {
var $node = table[ type ]( indexes ).nodes().to$();
$node.find('input.ipt_check').prop('checked', true);
@@ -535,6 +536,7 @@ jumpserver.initServerSideDataTable = function (options) {
if (type === 'row') {
var rows = table.rows(indexes).data();
$.each(rows, function (id, row) {
table.selected_rows.push(row);
if (row.id && $.inArray(row.id, table.selected) === -1){
table.selected.push(row.id)
}