mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
This commit is contained in:
parent
9e1b783bcb
commit
02adb9463d
@ -128,6 +128,8 @@ define(function(require) {
|
||||
}
|
||||
|
||||
function _initialize(opts) {
|
||||
var that = this;
|
||||
|
||||
TabDataTable.prototype.initialize.call(this, opts);
|
||||
|
||||
$('#' + this.dataTableId).on("click", '.vnc', function() {
|
||||
@ -155,5 +157,24 @@ define(function(require) {
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#' + this.dataTableId).on("change", 'tbody input.check_item', function() {
|
||||
if ($(this).is(":checked")){
|
||||
StateActions.enableStateActions($(this).attr("state"), $(this).attr("lcm_state"));
|
||||
} else {
|
||||
// First disable all actions
|
||||
StateActions.disableAllStateActions();
|
||||
|
||||
// Enable actions available to any of the selected VMs
|
||||
var nodes = $('tr', that.dataTable); //visible nodes only
|
||||
$.each($('input.check_item:checked', nodes), function(){
|
||||
StateActions.enableStateActions($(this).attr("state"), $(this).attr("lcm_state"));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -63,9 +63,12 @@ define(function(require) {
|
||||
}
|
||||
|
||||
return [
|
||||
'<input class="check_item" type="checkbox" id="' + RESOURCE.toLowerCase() + '_' +
|
||||
element.ID + '" name="selected_items" value="' +
|
||||
element.ID + '"/>',
|
||||
'<input class="check_item" '+
|
||||
'type="checkbox" '+
|
||||
'id="' + RESOURCE.toLowerCase() + '_' + element.ID + '" '+
|
||||
'name="selected_items" '+
|
||||
'value="' + element.ID + '" '+
|
||||
'state="'+element.STATE+'" lcm_state="'+element.LCM_STATE+'"/>',
|
||||
element.ID,
|
||||
element.UNAME,
|
||||
element.GNAME,
|
||||
|
@ -284,10 +284,10 @@ define(function(require) {
|
||||
this.dataTable.on("change", '.check_all', function() {
|
||||
var table = $(this).closest('.dataTables_wrapper');
|
||||
if ($(this).is(":checked")) { //check all
|
||||
$('tbody input.check_item', table).prop('checked', true);
|
||||
$('tbody input.check_item', table).prop('checked', true).change();
|
||||
$('td', table).addClass('markrowchecked');
|
||||
} else { //uncheck all
|
||||
$('tbody input.check_item', table).prop('checked', false);
|
||||
$('tbody input.check_item', table).prop('checked', false).change();
|
||||
$('td', table).removeClass('markrowchecked');
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user