Attribute to get a multiple select list

Attribute to get a multiple select list

egberteegberte Posts: 13Questions: 1Answers: 0
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

  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    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
  • egberteegberte Posts: 13Questions: 1Answers: 0
    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" }
    ]
    }
  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    It can be used in that block. `attr` is just another option.

    Allan
  • egberteegberte Posts: 13Questions: 1Answers: 0
    Thank you. things are coming along nicely with Editor - working with Bootstrap and the bootstrap date picker.
  • egberteegberte Posts: 13Questions: 1Answers: 0
    worked. Just needed quotes around "attr"

    [code]
    "label": "",
    "name": "selmonths",
    "attr": { multiple: true},
    "ipOpts": [
    { "label": "January", "value": "jan" },
    [/code]
This discussion has been closed.