mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 11:30:12 +03:00
added ability to use multi select widgets as for array type data
This commit is contained in:
parent
cf85ac97fd
commit
2dab29ca1b
|
@ -132,11 +132,18 @@ $(function () {
|
|||
params[paramKey] = value
|
||||
}
|
||||
} else if (dataType === 'array' && paramValue) {
|
||||
if($elem.is('select')){
|
||||
if(!(paramKey in params)) {
|
||||
params[paramKey] = []
|
||||
}
|
||||
params[paramKey].push(paramValue)
|
||||
} else {
|
||||
try {
|
||||
params[paramKey] = JSON.parse(paramValue)
|
||||
} catch (err) {
|
||||
// Ignore malformed JSON
|
||||
}
|
||||
}
|
||||
} else if (dataType === 'object' && paramValue) {
|
||||
try {
|
||||
params[paramKey] = JSON.parse(paramValue)
|
||||
|
|
Loading…
Reference in New Issue
Block a user