summaryrefslogtreecommitdiff
path: root/views/js
diff options
context:
space:
mode:
Diffstat (limited to 'views/js')
-rw-r--r--views/js/editable.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/views/js/editable.js b/views/js/editable.js
index c2275ec..9717064 100644
--- a/views/js/editable.js
+++ b/views/js/editable.js
@@ -28,10 +28,23 @@
if (options.type == "select" && typeof options.data == "string")
{
+ var ar = [];
+ var arData = jQuery.parseJSON(options.data);
+ var strValue = jQuery(this).html();
+ var value = 0;
+
+ for (var i in arData)
+ {
+
+ ar.push( { 'value': i, 'text': arData[i] } );
+ if (arData[i] == strValue) value = i;
+
+ }
+
// Normale Übergabe eines JSON Strings
- opt.source = jQuery.parseJSON(options.data);
+ opt.source = ar;
opt.type = 'select';
- opt.value = options.value;
+ opt.value = value;
}
else if (options.type == 'multiarray')