From 6a73bb66e3089e330de3ebbe646027c8a38504ef Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 30 Apr 2015 14:32:06 +0200 Subject: [PATCH] feature #3748: Set options for data tables --- .../public/app/utils/tab-datatable.js | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/sunstone/public/app/utils/tab-datatable.js b/src/sunstone/public/app/utils/tab-datatable.js index 6ff6f1bd2d..3fc0c4a952 100644 --- a/src/sunstone/public/app/utils/tab-datatable.js +++ b/src/sunstone/public/app/utils/tab-datatable.js @@ -65,6 +65,7 @@ define(function(require) { 'getElementData': _getElementData, 'waitingNodes': _waitingNodes, 'recountCheckboxes': _recountCheckboxes, + 'filter': _filter } return TabDatatable; @@ -85,10 +86,19 @@ define(function(require) { that.recountCheckboxes(that.dataTable); }) - this.initCheckAllBoxes(); - this.tableCheckboxesListener(); - this.infoListener(this.resource + ".show"); + + this.dataTable.fnSetColumnVis(0, false); this.dataTable.fnSort([[1, SunstoneConfig.tableOrder]]); + + if (this.conf.actions) { + this.dataTable.fnSetColumnVis(0, true); + this.initCheckAllBoxes(); + this.tableCheckboxesListener(); + } + + if (this.conf.info) { + this.infoListener(this.resource + ".show", this.tabId); + } } //Shows run a custom action when clicking on rows. @@ -379,4 +389,8 @@ define(function(require) { }; return selected_nodes; } + + function _filter(value, columnId) { + this.dataTable.fnFilter(value, columnId); + } })