User group detail

This commit is contained in:
ibuler
2016-11-15 00:48:48 +08:00
parent 8d358a7a68
commit bd882c8bef
9 changed files with 224 additions and 154 deletions

View File

@@ -297,6 +297,7 @@ jumpserver.initDataTable = function (options) {
url: options.i18n_url || "/static/js/plugins/dataTables/i18n/zh-hans.json"
},
order: options.order || [[ 1, 'asc' ]],
select: options.select || 'multi',
buttons: options.buttons || [
{extend: 'excel',
exportOptions: {
@@ -323,9 +324,6 @@ jumpserver.initDataTable = function (options) {
}
],
columnDefs: columnDefs,
// select: 'single',
// select: options.select || {style: 'single'},
// select: false,
ajax: {
url: options.ajax_url ,
dataSrc: ""
@@ -333,16 +331,16 @@ jumpserver.initDataTable = function (options) {
columns: options.columns || [],
lengthMenu: [[15, 25, 50, -1], [15, 25, 50, "All"]]
});
// table.on('select', function(e, dt, type, indexes) {
// var $node = table[ type ]( indexes ).nodes().to$();
// $node.find('input.ipt_check').prop('checked', true);
// }).on('deselect', function(e, dt, type, indexes) {
// var $node = table[ type ]( indexes ).nodes().to$();
// $node.find('input.ipt_check').prop('checked', false);
// }).on('draw', function(){
// $('#op').html(options.op_html || '');
// $('#uc').html(options.uc_html || '');
// });
table.on('select', function(e, dt, type, indexes) {
var $node = table[ type ]( indexes ).nodes().to$();
$node.find('input.ipt_check').prop('checked', true);
}).on('deselect', function(e, dt, type, indexes) {
var $node = table[ type ]( indexes ).nodes().to$();
$node.find('input.ipt_check').prop('checked', false);
}).on('draw', function(){
$('#op').html(options.op_html || '');
$('#uc').html(options.uc_html || '');
});
$('.ipt_check_all').on('click', function() {
if (!jumpserver.checked) {
$(this).closest('table').find('.ipt_check').prop('checked', true);
@@ -354,5 +352,6 @@ jumpserver.initDataTable = function (options) {
table.rows().deselect();
}
});
return table;
};