diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2016-08-13 13:40:36 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2016-08-13 13:40:36 +0000 |
| commit | f4d68ae74cdcd77e40de63fdbe5ee8ab4c63920c (patch) | |
| tree | 3acd256706ae6e9f5578e5afd3fcff17832d9458 /views/js/editable.js | |
| parent | 5dc953f0c42207bf8276812e19315ccd40592c74 (diff) | |
- Bestellansicht Umbau der Moduleinbindung in Reiter
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5720 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/js/editable.js')
| -rw-r--r-- | views/js/editable.js | 43 |
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);
|
