≡
×
Plus
Manual
Examples
Reference
Download
Blog
Community
Support
Attribute to get a multiple select list
Attribute to get a multiple select list
egberte
Posts: 13
Questions: 1
Answers: 0
February 2014
edited February 2014
in
Editor
I want a select but of this boot strap type: (select example #2 here: http://getbootstrap.com/css/#forms-controls)
How do I get a multiple selection pick list via the SELECT field type?
Replies
allan
Posts: 65,813
Questions: 1
Answers: 10,949
Site admin
February 2014
You can set the multiple attribute using the `attr` option: https://editor.datatables.net/fields/#select
[code]
{
name: "myField",
label: "My Field",
attr: {
multiple: true
}
}
[/code]
Allan
egberte
Posts: 13
Questions: 1
Answers: 0
February 2014
This syntax differs from what i am using. Is this for an API call or can it be used in the following block:
{
"type": "select",
"label": "",
"name": "selmonths",
"ipOpts": [
{ "label": "January", "value": "jan" },
{ "label": "February", "value": "feb" },
{ "label": "March", "value": "mar" },
{ "label": "April", "value": "aprl" },
{ "label": "May", "value": "may" },
{ "label": "June", "value": "jun" },
{ "label": "July", "value": "jul" },
{ "label": "August", "value": "aug" },
{ "label": "September", "value": "sept" },
{ "label": "October", "value": "oct" },
{ "label": "November", "value": "nov" },
{ "label": "December", "value": "dec" }
]
}
allan
Posts: 65,813
Questions: 1
Answers: 10,949
Site admin
February 2014
It can be used in that block. `attr` is just another option.
Allan
egberte
Posts: 13
Questions: 1
Answers: 0
February 2014
Thank you. things are coming along nicely with Editor - working with Bootstrap and the bootstrap date picker.
egberte
Posts: 13
Questions: 1
Answers: 0
February 2014
worked. Just needed quotes around "attr"
[code]
"label": "",
"name": "selmonths",
"attr": { multiple: true},
"ipOpts": [
{ "label": "January", "value": "jan" },
[/code]
This discussion has been closed.
Replies
[code]
{
name: "myField",
label: "My Field",
attr: {
multiple: true
}
}
[/code]
Allan
{
"type": "select",
"label": "",
"name": "selmonths",
"ipOpts": [
{ "label": "January", "value": "jan" },
{ "label": "February", "value": "feb" },
{ "label": "March", "value": "mar" },
{ "label": "April", "value": "aprl" },
{ "label": "May", "value": "may" },
{ "label": "June", "value": "jun" },
{ "label": "July", "value": "jul" },
{ "label": "August", "value": "aug" },
{ "label": "September", "value": "sept" },
{ "label": "October", "value": "oct" },
{ "label": "November", "value": "nov" },
{ "label": "December", "value": "dec" }
]
}
Allan
[code]
"label": "",
"name": "selmonths",
"attr": { multiple: true},
"ipOpts": [
{ "label": "January", "value": "jan" },
[/code]