diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab.js b/src/sunstone/public/app/tabs/oneflow-services-tab.js index 846d63807c..66ae3b1838 100644 --- a/src/sunstone/public/app/tabs/oneflow-services-tab.js +++ b/src/sunstone/public/app/tabs/oneflow-services-tab.js @@ -12,7 +12,8 @@ define(function(require) { ]; var _panels = [ - require('./oneflow-services-tab/panels/info') + require('./oneflow-services-tab/panels/info'), + require('./oneflow-services-tab/panels/roles') ]; var _formPanels = [ diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js b/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js index d180309081..0e59391fac 100644 --- a/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/actions.js @@ -3,14 +3,39 @@ define(function(require) { var Notifier = require('utils/notifier'); var Locale = require('utils/locale'); var OpenNebulaResource = require('opennebula/service'); + var OpenNebulaRole = require('opennebula/role'); + var OpenNebulaVM = require('opennebula/vm'); var CommonActions = require('utils/common-actions'); var TAB_ID = require('./tabId'); var XML_ROOT = "DOCUMENT"; var RESOURCE = "Service"; + var ROLES_PANEL_ID = require('./panels/roles/panelId'); + var _commonActions = new CommonActions(OpenNebulaResource, RESOURCE, TAB_ID); + function roleElements() { + var selected_nodes = []; + + var dataTable = $('#datatable_service_roles', '#'+TAB_ID+' #'+ROLES_PANEL_ID); + var nodes = $('tbody input.check_item:checked', dataTable); + $.each(nodes, function() { + selected_nodes.push($(this).val()); + }); + + return selected_nodes; + } + + function roleVMElements() { + // TODO + //return getSelectedNodes(serviceroleVMsDataTable, true); + } + + function roleCallback() { + return Sunstone.runAction('Service.refresh'); + } + var _actions = { "Service.show" : _commonActions.show(), "Service.refresh" : _commonActions.refresh(), @@ -37,7 +62,7 @@ define(function(require) { type: "multiple", call: OpenNebula.Service.shutdown, elements: serviceElements, - error: onError, + error: Notifier.onError, notify: true }, @@ -45,11 +70,390 @@ define(function(require) { type: "multiple", call: OpenNebula.Service.recover, elements: serviceElements, - error: onError, + error: Notifier.onError, notify: true } - */ + + //-------------------------------------------------------------------------- + + /* TODO + "Role.update_dialog" : { + type: "custom", + call: popUpScaleDialog + }, + + "Role.update" : { + type: "multiple", + call: OpenNebulaRole.update, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + */ + + "Role.hold" : { + type: "multiple", + call: OpenNebulaRole.hold, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.release" : { + type: "multiple", + call: OpenNebulaRole.release, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.suspend" : { + type: "multiple", + call: OpenNebulaRole.suspend, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.resume" : { + type: "multiple", + call: OpenNebulaRole.resume, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.stop" : { + type: "multiple", + call: OpenNebulaRole.stop, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.reboot_hard" : { + type: "multiple", + call: OpenNebulaRole.reboot_hard, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.delete_recreate" : { + type: "multiple", + call: OpenNebulaRole.delete_recreate, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.reboot" : { + type: "multiple", + call: OpenNebulaRole.reboot, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.poweroff" : { + type: "multiple", + call: OpenNebulaRole.poweroff, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.poweroff_hard" : { + type: "multiple", + call: OpenNebulaRole.poweroff_hard, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.undeploy" : { + type: "multiple", + call: OpenNebulaRole.undeploy, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.undeploy_hard" : { + type: "multiple", + call: OpenNebulaRole.undeploy_hard, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.snapshot_create" : { + type: "single", + call: OpenNebulaRole.snapshot_create, + callback: roleCallback, + error: Notifier.onError, + notify: true + }, + + "Role.shutdown" : { + type: "multiple", + call: OpenNebulaRole.shutdown, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.shutdown_hard" : { + type: "multiple", + call: OpenNebulaRole.cancel, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.delete" : { + type: "multiple", + call: OpenNebulaRole.del, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + "Role.recover" : { + type: "multiple", + call: OpenNebulaRole.recover, + callback: roleCallback, + elements: roleElements, + error: Notifier.onError, + notify: true + }, + + //-------------------------------------------------------------------------- + + "RoleVM.deploy" : { + type: "multiple", + call: OpenNebulaVM.deploy, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.migrate" : { + type: "multiple", + call: OpenNebulaVM.migrate, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.migrate_live" : { + type: "multiple", + call: OpenNebulaVM.livemigrate, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.hold" : { + type: "multiple", + call: OpenNebulaVM.hold, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.release" : { + type: "multiple", + call: OpenNebulaVM.release, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.suspend" : { + type: "multiple", + call: OpenNebulaVM.suspend, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.resume" : { + type: "multiple", + call: OpenNebulaVM.resume, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.stop" : { + type: "multiple", + call: OpenNebulaVM.stop, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.reboot_hard" : { + type: "multiple", + call: OpenNebulaVM.reset, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.delete_recreate" : { + type: "multiple", + call: OpenNebulaVM.resubmit, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.reboot" : { + type: "multiple", + call: OpenNebulaVM.reboot, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.poweroff" : { + type: "multiple", + call: OpenNebulaVM.poweroff, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.poweroff_hard" : { + type: "multiple", + call: OpenNebulaVM.poweroff_hard, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.undeploy" : { + type: "multiple", + call: OpenNebulaVM.undeploy, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.undeploy_hard" : { + type: "multiple", + call: OpenNebulaVM.undeploy_hard, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.shutdown" : { + type: "multiple", + call: OpenNebulaVM.shutdown, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.shutdown_hard" : { + type: "multiple", + call: OpenNebulaVM.cancel, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.delete" : { + type: "multiple", + call: OpenNebulaVM.del, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.recover" : { + type: "multiple", + call: OpenNebulaVM.recover, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.resched" : { + type: "multiple", + call: OpenNebulaVM.resched, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.unresched" : { + type: "multiple", + call: OpenNebulaVM.unresched, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + + "RoleVM.chown" : { + type: "multiple", + call: OpenNebulaVM.chown, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + }, + "RoleVM.chgrp" : { + type: "multiple", + call: OpenNebulaVM.chgrp, + callback: roleCallback, + elements: roleVMElements, + error: Notifier.onError, + notify: true + } + + }; return _actions; diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles.js b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles.js new file mode 100644 index 0000000000..23190063e2 --- /dev/null +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles.js @@ -0,0 +1,161 @@ +define(function(require) { + /* + DEPENDENCIES + */ + + var Locale = require('utils/locale'); + var Tips = require('utils/tips'); + var OpenNebulaRole = require('opennebula/role'); + var roles_buttons = require('./roles/roles-buttons'); + var Sunstone = require('sunstone'); + var RolesDataTable = require('./roles/roles-datatable'); + + /* + TEMPLATES + */ + + var TemplateHTML = require('hbs!./roles/html'); + var TemplateRoleInfo = require('hbs!./roles/roleInfo'); + + /* + CONSTANTS + */ + + var TAB_ID = require('../tabId'); + var PANEL_ID = require('./roles/panelId'); + var XML_ROOT = "DOCUMENT"; + var RESOURCE = "Service"; + + /* + CONSTRUCTOR + */ + + function Panel(info) { + this.title = Locale.tr("Roles"); + this.icon = "fa-wrench"; + + this.element = info[XML_ROOT]; + + this.selected_row_role_id = undefined; + + return this; + } + + Panel.PANEL_ID = PANEL_ID; + Panel.prototype.html = _html; + Panel.prototype.setup = _setup; + Panel.prototype.roleHTML = _roleHTML; + Panel.prototype.roleSetup = _roleSetup; + + return Panel; + + /* + FUNCTION DEFINITIONS + */ + + function _html() { + var roleList = []; + + var roles = this.element.TEMPLATE.BODY.roles; + if (roles && roles.length) { + $.each(roles, function(){ + roleList.push( + { + 'name': this.name, + 'state': OpenNebulaRole.state(this.state), + 'cardinality': this.cardinality, + 'vm_template': this.vm_template, + 'parents': this.parents ? this.parents.join(', ') : '-' + }); + }); + } + + return TemplateHTML({ + 'element': this.element, + 'roleList': roleList + }); + } + + function _setup(context) { + var that = this; + + Tips.setup(context); + + that.last_selected_row_role = undefined; + + var roles = this.element.TEMPLATE.BODY.roles; + if (roles && roles.length) { + this.servicerolesDataTable = new RolesDataTable( + 'datatable_service_roles', + { + actions: true, + info: false, + oneSelection: true, + customTabContext: $('#role_actions', context), + customTrListener: function(tableObj, tr){ + var aData = tableObj.dataTable.fnGetData(tr); + var role_name = $(aData[0]).val(); + + var role_index = tableObj.dataTable.fnGetPosition(tr); + + $("#roles_extended_info", context).html(that.roleHTML(role_index)); + that.roleSetup($("#roles_extended_info", context), role_index); + + // The info listener is triggered instead of + // the row selection. So we click the check input to select + // the row also + var check = $('.check_item', tr); + if (!check.is(":checked")) { + check.trigger('click'); + } + } + }); + + this.servicerolesDataTable.initialize(); + + Sunstone.insertButtonsInTab("oneflow-services", "service_roles_tab", roles_buttons, $('#role_actions', context)); + + // TODO + //setupScaleDialog(); + + // TODO: global var, see Service.refresh + /* + if(selected_row_role_id) { + $.each($(this.servicerolesDataTable.dataTable.fnGetNodes()),function(){ + if($($('td',this)[1]).html()==selected_row_role_id) { + $('td',this)[2].click(); + } + }); + } + + if(checked_row_rolevm_ids.length!=0) { + $.each($(serviceroleVMsDataTable.fnGetNodes()),function(){ + var current_id = $($('td',this)[1]).html(); + if (current_id) { + if(jQuery.inArray(current_id, checked_row_rolevm_ids)!=-1) { + $('input.check_item',this).first().click(); + $('td',this).addClass('markrowchecked'); + } + } + }); + } + //*/ + } + } + + + function _roleHTML(role_index) { + var role = this.element.TEMPLATE.BODY.roles[role_index]; + + // TODO: role VMs table + + return TemplateRoleInfo({ + 'role': role, + 'vmsTableHTML': "

TODO

" + }); + } + + function _roleSetup(context, role_index) { + Tips.setup(context); + } +}); diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/html.hbs b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/html.hbs new file mode 100644 index 0000000000..d0dac47e55 --- /dev/null +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/html.hbs @@ -0,0 +1,71 @@ +
+
+
+
+

{{tr "Roles"}}

+
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+
+ + + + + + + + + + + + + {{#each roleList}} + + + + + + + + + {{/each}} + +
{{tr "Name"}}{{tr "State"}}{{tr "Cardinality"}}{{tr "VM Template"}}{{tr "Parents"}}
{{name}}{{state}}{{cardinality}}{{vm_template}}{{parents}}
+
+
+
+ + + + +
+
+ + {{tr "Select a role in the table for more information"}} + +
+
+
+ +
\ No newline at end of file diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/panelId.js b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/panelId.js new file mode 100644 index 0000000000..98641a6cc5 --- /dev/null +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/panelId.js @@ -0,0 +1,3 @@ +define(function(require){ + return 'service_roles_tab'; +}); \ No newline at end of file diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roleInfo.hbs b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roleInfo.hbs new file mode 100644 index 0000000000..b7f5cdea3f --- /dev/null +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roleInfo.hbs @@ -0,0 +1,146 @@ +
+

{{tr "Role"}} - {{role.name}}

+
+ + + + + + + + + + + + + + + + + + +
{{tr "Information"}}
{{tr "Shutdown action"}}{{valOrDefault role.shutdown_action "-"}}{{tr "Cooldown"}}{{valOrDefault role.cooldown "-"}}{{tr "Min VMs"}}{{valOrDefault role.min_vms "-"}}{{tr "Max VMs"}}{{valOrDefault role.max_vms "-"}}
+
+
+
+ {{tr "Virtual Machines"}} +
+
+
+
+
+ {{{vmsTableHTML}}} +
+
+
+
+ {{#if role.elasticity_policies}} + + + + + + + + + + + + + + + + + + + + {{#each role.elasticity_policies}} + + + + + + + + + + {{/each}} + +
{{tr "Elasticity policies"}}

+ {{tr "CHANGE: Add/substract the given number of VMs."}}
+ {{tr "CARDINALITY: Set the cardinality to the given number."}}
+ {{tr "PERCENTAGE_CHANGE: Add/substract the given percentage to the current cardinality."}} + " style="width:14%">{{tr "Type"}} +

+ {{tr "CHANGE: -2, will substract 2 VMs from the role"}}
+ {{tr "CARDINALITY: 8, will set carditanilty to 8"}}
+ {{tr "PERCENTAGE_CHANGE: 20, will increment cardinality by 20%"}}" style="width:12%">{{tr "Adjust"}} +
+ {{tr " If present, the policy will change the cardinality by at least the number of VMs set in this attribute."}}" style="width:9%">{{tr "Min"}} +
+ {{tr "Example: ATT < 20"}}" style="width:30%">{{tr "Expression"}} +
# + {{tr "Period"}} + {{tr "Cooldown"}} +
{{type}}{{adjust}}{{valOrDefault min_adjust_step "-"}}{{valOrDefault expression_evaluated this.expression}} + {{#if period_number}} + {{valOrDefault true_evals "0"}}/{{period_number}} + {{else}} + - + {{/if}} + {{valOrDefault period "-"}}{{valOrDefault cooldown "-"}}
+ {{/if}} +
+ {{#if role.scheduled_policies}} + + + + + + + + + + + + + + + + + + {{#each role.scheduled_policies}} + + + + + {{#if start_time}} + + + {{else}} + {{#if recurrence}} + + + {{/if}} + {{/if}} + + {{/each}} + +
{{tr "Scheduled policies"}}

+ {{tr "CHANGE: Add/substract the given number of VMs."}}
+ {{tr "CARDINALITY: Set the cardinality to the given number."}}
+ {{tr "PERCENTAGE_CHANGE: Add/substract the given percentage to the current cardinality."}}" style="width:14%">{{tr "Type"}} +

+ {{tr "CHANGE: -2, will substract 2 VMs from the role"}}
+ {{tr "CARDINALITY: 8, will set carditanilty to 8"}}
+ {{tr "PERCENTAGE_CHANGE: 20, will increment cardinality by 20%"}}" style="width:12%">{{tr "Adjust"}} +
{{tr "Min"}} +
+ {{tr "Start time: Exact time for the adjustement"}}" style="width:28%">{{tr "Time format"}} +

+ {{tr "Recurrence: Time for recurring adjustements. Time is specified with the Unix cron syntax"}}
+ {{tr "Start time: Exact time for the adjustement"}}" style="width:33%">{{tr "Time expression"}} +
{{type}}{{adjust}}{{valOrDefault min_adjust_step ""}}{{tr "Start time"}}{{start_time}}{{tr "Recurrence"}}{{recurrence}}
+ {{/if}} +
+
\ No newline at end of file diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-buttons.js b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-buttons.js new file mode 100644 index 0000000000..8086fc80c8 --- /dev/null +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-buttons.js @@ -0,0 +1,104 @@ +define(function(require) { + var Locale = require('utils/locale'); + + var Buttons = { + "Role.update_dialog" : { + type: "action", + text: Locale.tr("Scale"), + tip: Locale.tr("This will hold selected pending VMs from being deployed"), + layout: "create" + }, + "Role.hold" : { + type: "action", + text: Locale.tr("Hold"), + tip: Locale.tr("This will hold selected pending VMs from being deployed"), + layout: "vmsplanification_buttons" + }, + "Role.release" : { + type: "action", + text: Locale.tr("Release"), + layout: "vmsplanification_buttons", + tip: Locale.tr("This will release held machines") + }, + "Role.suspend" : { + type: "action", + text: Locale.tr("Suspend"), + layout: "vmspause_buttons", + tip: Locale.tr("This will suspend selected machines") + }, + "Role.resume" : { + type: "action", + text: '', + layout: "vmsplay_buttons", + tip: Locale.tr("This will resume selected VMs") + }, + "Role.stop" : { + type: "action", + text: Locale.tr("Stop"), + layout: "vmsstop_buttons", + tip: Locale.tr("This will stop selected VMs") + }, + "Role.reboot" : { + type: "action", + text: Locale.tr("Reboot"), + layout: "vmsrepeat_buttons", + tip: Locale.tr("This will send a reboot action to running VMs") + }, + "Role.reboot_hard" : { + type: "action", + text: Locale.tr("Reboot") + ' hard', + layout: "vmsrepeat_buttons", + tip: Locale.tr("This will perform a hard reboot on selected VMs") + }, + "Role.poweroff" : { + type: "action", + text: Locale.tr("Power Off"), + layout: "vmspause_buttons", + tip: Locale.tr("This will send a power off signal to running VMs. They can be resumed later.") + }, + "Role.poweroff_hard" : { + type: "action", + text: Locale.tr("Power Off") + ' hard', + layout: "vmspause_buttons", + tip: Locale.tr("This will send a forced power off signal to running VMs. They can be resumed later.") + }, + "Role.undeploy" : { + type: "action", + text: Locale.tr("Undeploy"), + layout: "vmsstop_buttons", + tip: Locale.tr("Shuts down the given VM. The VM is saved in the system Datastore.") + }, + "Role.undeploy_hard" : { + type: "action", + text: Locale.tr("Undeploy") + ' hard', + layout: "vmsstop_buttons", + tip: Locale.tr("Shuts down the given VM. The VM is saved in the system Datastore.") + }, + "Role.shutdown" : { + type: "action", + text: Locale.tr("Shutdown"), + layout: "vmsdelete_buttons", + tip: Locale.tr("This will initiate the shutdown process in the selected VMs") + }, + "Role.shutdown_hard" : { + type: "action", + text: Locale.tr("Shutdown") + ' hard', + layout: "vmsdelete_buttons", + tip: Locale.tr("This will initiate the shutdown-hard (forced) process in the selected VMs") + }, + "Role.delete" : { + type: "action", + text: Locale.tr("Delete"), + layout: "vmsdelete_buttons", + tip: Locale.tr("This will delete the selected VMs from the database") + }, + "Role.delete_recreate" : { + type: "action", + text: Locale.tr("Delete") + ' recreate', + layout: "vmsrepeat_buttons", + tip: Locale.tr("This will delete and recreate VMs to PENDING state") + } + }; + + return Buttons; +}); \ No newline at end of file diff --git a/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-datatable.js b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-datatable.js new file mode 100644 index 0000000000..9ae4fb5be1 --- /dev/null +++ b/src/sunstone/public/app/tabs/oneflow-services-tab/panels/roles/roles-datatable.js @@ -0,0 +1,53 @@ +define(function(require) { + /* + DEPENDENCIES + */ + + var TabDataTable = require('utils/tab-datatable'); + var SunstoneConfig = require('sunstone-config'); + var Locale = require('utils/locale'); + + /* + CONSTRUCTOR + */ + + function Table(dataTableId, conf) { + this.conf = conf || {}; + //this.tabId = TAB_NAME; + this.dataTableId = dataTableId; + //this.resource = RESOURCE; + //this.xmlRoot = XML_ROOT; + + // TODO: hide checkbox column + + + this.dataTableOptions = { + "bAutoWidth": false, + "bSortClasses" : false, + "bDeferRender": true, + "aoColumnDefs": [ + {"bSortable": false, "aTargets": ["check"]}, + //{"bVisible": false, "aTargets": [0]} + //{"bVisible": true, "aTargets": [1,2,3,4,5]}, + //{"bVisible": false, "aTargets": ['_all']} + ] + }; + + //this.columns = []; + //this.selectOptions = {}; + + TabDataTable.call(this); + } + + Table.prototype = Object.create(TabDataTable.prototype); + Table.prototype.constructor = Table; + //Table.prototype.elementArray = _elementArray; + + return Table; + + /* + FUNCTION DEFINITIONS + */ + + //function _elementArray(element_json) {} +});