From 572bb3f692c90d6d532af4a87668cfbab05f70b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 10 Jun 2015 15:48:33 +0200 Subject: [PATCH] Feature #3748: Fix bug in tab-datatable.selectResourceTableSelect --- src/sunstone/public/app/utils/tab-datatable.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/app/utils/tab-datatable.js b/src/sunstone/public/app/utils/tab-datatable.js index 05c0f22d25..06279b8354 100644 --- a/src/sunstone/public/app/utils/tab-datatable.js +++ b/src/sunstone/public/app/utils/tab-datatable.js @@ -752,6 +752,13 @@ define(function(require) { $('#refresh_button_' + that.dataTableId, section).click(); } + /** + * Clears the current selection, and selects the given IDs + * @param {object} selectedResources Two alternatives, ids or names. + * - selectedResources.ids must be a single ID, + * or an array of IDs for options.multiple_choice + * - selectedResources.names must be an array of {name, uname} + */ function _selectResourceTableSelect(selectedResources) { var that = this; var section = $('#' + that.dataTableId + 'Container'); @@ -817,9 +824,9 @@ define(function(require) { var row_id = undefined; var row_name = ""; - if (that.selectOptions.ids != undefined) { + if (selectedResources.ids != undefined) { - row_id = that.selectOptions.ids; + row_id = selectedResources.ids; row_name = "" + row_id;