From 180fab45a22567a59818bebdfde78a0636ec3851 Mon Sep 17 00:00:00 2001 From: jimjaeger Date: Sun, 24 Jul 2016 18:02:43 +0200 Subject: [PATCH] Update core.data.js Fix array value handling in _fnSetObjectDataFn function to correct store array notation value in array instead of string. --- js/core/core.data.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/core/core.data.js b/js/core/core.data.js index a1b453dd0..52971fc74 100644 --- a/js/core/core.data.js +++ b/js/core/core.data.js @@ -416,9 +416,17 @@ function _fnSetObjectDataFn( mSource ) } else { - // If array notation is used, we just want to strip it and use the property name + arrayNotation = aLast.match(__reArray); + var r = val; + if (arrayNotation){ + // if array notation, we have to catch the array seperator + var join = arrayNotation[0].substring(1, arrayNotation[0].length-1); + // split into array, if no value set emtpy array + r = val.length > 0 ? val.split(join) : []; + } + // If array notation is used, we just want to strip it and use the property name // and assign the value. If it isn't used, then we get the result we want anyway - data[ aLast.replace(__reArray, '') ] = val; + data[ aLast.replace(__reArray, '') ] = r; } };