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,10 +132,17 @@ $(function () {
|
||||||
params[paramKey] = value
|
params[paramKey] = value
|
||||||
}
|
}
|
||||||
} else if (dataType === 'array' && paramValue) {
|
} else if (dataType === 'array' && paramValue) {
|
||||||
try {
|
if($elem.is('select')){
|
||||||
params[paramKey] = JSON.parse(paramValue)
|
if(!(paramKey in params)) {
|
||||||
} catch (err) {
|
params[paramKey] = []
|
||||||
// Ignore malformed JSON
|
}
|
||||||
|
params[paramKey].push(paramValue)
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
params[paramKey] = JSON.parse(paramValue)
|
||||||
|
} catch (err) {
|
||||||
|
// Ignore malformed JSON
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (dataType === 'object' && paramValue) {
|
} else if (dataType === 'object' && paramValue) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user