diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2016-11-16 10:47:54 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2016-11-16 10:47:54 +0000 |
| commit | 4e788242bdb85682ba13dcb0caf2d72348479cf4 (patch) | |
| tree | 92676d224610d7d27d25b0d030fb183f662b4b8d /views/js/editable.js | |
| parent | 60862ddf25ead18d565fbf5d5fc3129e0822106e (diff) | |
- Export Profil (FTP Speicherung / Cron ausführung / XML Erstellung)
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5911 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/js/editable.js')
| -rw-r--r-- | views/js/editable.js | 63 |
1 files changed, 12 insertions, 51 deletions
diff --git a/views/js/editable.js b/views/js/editable.js index 353c576..e4eb68f 100644 --- a/views/js/editable.js +++ b/views/js/editable.js @@ -25,50 +25,30 @@ if (typeof options.type == "string") opt['type'] = options.type;
- 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 = ar;
- opt.type = 'select';
- opt.value = value;
-
- }
- else if (options.type == "select" && typeof options.data == "object")
+ if (options.type == "select" && Array.isArray(options.data))
{
-
- var value = 0;
+
+ var value = "0";
var strValue = jQuery(this).html();
for (var i in options.data)
{
-
- if (options.data[i] == strValue) value = i;
+
+ if (options.data[i].text == strValue) value = options.data[i].value;
}
opt.source = options.data;
- opt.value = value
+ opt.type = 'select';
+ opt.value = value;
- }
+ }
else if (options.type == 'multiarray')
{
var ar = [];
var arData = jQuery.parseJSON(options.data);
+ var strValue = jQuery(this).html();
for (var i in arData)
{
@@ -80,6 +60,8 @@ objData['children'].push( { 'value': j, 'text': arData[i]['fields'][j] } );
+ if (arData[i]['fields'][j] == strValue) value = j;
+
}
ar.push(objData);
@@ -88,29 +70,8 @@ opt.source = ar;
opt.type = 'select';
+ opt.value = j;
- }
- else if (options.type == 'string' && typeof options.data == "string")
- {
-
- var ar = [];
- var arData = jQuery.parseJSON(options.data);
-
- for (var i in arData)
- {
-
- ar.push( {
- 'value': i,
- 'text': arData[i]
- } );
-
- if (arData[i] == jQuery(this).text()) opt.value = i;
-
- }
-
- opt.type = 'select';
- opt.source = ar;
-
}
else
{
|
