From e9458ca8452083eef595f8b678e33ce1d8788f0f Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 17 Mar 2015 10:59:47 +0100 Subject: [PATCH] feature #3668: Options can define a different name than the value --- src/sunstone/public/js/sunstone.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/js/sunstone.js b/src/sunstone/public/js/sunstone.js index 770d273d44..90b57dd193 100644 --- a/src/sunstone/public/js/sunstone.js +++ b/src/sunstone/public/js/sunstone.js @@ -8173,7 +8173,9 @@ function sg_rule_to_st(rule){ @param opts.id key of the OpenNebula Template @param opts.label name to be shown as label @param opts.tooltip - @param opts.options array of options for the select + @param opts.options + array of options for the select + the option can be a string or an object {name: XXX, value: XXX} @param opts.custom boolean, provide a text input for a custom value (default: false) @param opts.no_empty_option do not provide an empty option @return {string} @@ -8196,7 +8198,11 @@ function generateValueSelect(opts){ } $.each(opts.options, function(index, option){ - str += ''; + if (option.name) { + str += ''; + } else { + str += ''; + } }); if (opts.custom) {