summaryrefslogtreecommitdiff
path: root/views/js/editable.js
diff options
context:
space:
mode:
Diffstat (limited to 'views/js/editable.js')
-rw-r--r--views/js/editable.js43
1 files changed, 39 insertions, 4 deletions
diff --git a/views/js/editable.js b/views/js/editable.js
index 280730b..c9ccda8 100644
--- a/views/js/editable.js
+++ b/views/js/editable.js
@@ -25,11 +25,46 @@
if (typeof options.type == "string") opt['type'] = options.type;
- if (options.type == 'string' && typeof options.data == "string") {
-
+ if (options.type == "select" && typeof options.data == "string")
+ {
+
+ // Normale Übergabe eines JSON Strings
+ opt.source = jQuery.parseJSON(options.data);
+ opt.type = 'select';
+
+ }
+ else if (options.type == 'multiarray')
+ {
+
+ var ar = [];
+ var arData = jQuery.parseJSON(options.data);
+
+ for (var i in arData)
+ {
+
+ objData = { 'text': arData[i].name, 'children': [] };
+
+ for (var j in arData[i]['fields'])
+ {
+
+ objData['children'].push( { 'value': j, 'text': arData[i]['fields'][j] } );
+
+ }
+
+ ar.push(objData);
+
+ }
+
+ opt.source = ar;
+ opt.type = 'select';
+
+ }
+ else if (options.type == 'string' && typeof options.data == "string")
+ {
+
var ar = [];
var arData = jQuery.parseJSON(options.data);
-
+
for (var i in arData)
{
@@ -48,7 +83,7 @@
}
else
{
-
+
opt.display = function(value, sourceData) {
jQuery(this).html(sourceData);