added ability to use multi select widgets as for array type data

This commit is contained in:
Dan Bate 2018-06-26 11:23:30 +01:00
parent cf85ac97fd
commit 2dab29ca1b

View File

@ -132,11 +132,18 @@ $(function () {
params[paramKey] = value params[paramKey] = value
} }
} else if (dataType === 'array' && paramValue) { } else if (dataType === 'array' && paramValue) {
if($elem.is('select')){
if(!(paramKey in params)) {
params[paramKey] = []
}
params[paramKey].push(paramValue)
} else {
try { try {
params[paramKey] = JSON.parse(paramValue) params[paramKey] = JSON.parse(paramValue)
} catch (err) { } catch (err) {
// Ignore malformed JSON // Ignore malformed JSON
} }
}
} else if (dataType === 'object' && paramValue) { } else if (dataType === 'object' && paramValue) {
try { try {
params[paramKey] = JSON.parse(paramValue) params[paramKey] = JSON.parse(paramValue)