select2 attributes, init, and example

select2 attributes, init, and example

rboudwinrboudwin Posts: 28Questions: 6Answers: 1
  1. Where is a list of the object attr: Attributes that are applied to the select element before Select2? I don't see this list in the documentation:
    https://editor.datatables.net/plug-ins/field-type/editor.select2

  2. Is there a preferred version of select2 to work properly with datatables?

  3. Is there a good working example of select2 init?

This question has an accepted answers - jump to answer

Answers

  • rboudwinrboudwin Posts: 28Questions: 6Answers: 1
    edited December 2018

    Also, (1) placeholder doesn't appear to be working in the example provided and (2) where/how are the states loaded:

    editor.add( {
        "label": "Make of automobile:",
        "name": "automake",
        "type": "select2",
        "opts": {
            "allowClear": true,
            "placeholder": {
                "id": "",
                "text":"(Does not own automobile)"
            }
        }
    }
    
  • rboudwinrboudwin Posts: 28Questions: 6Answers: 1

    In answer to my placeholder question and to help others, it appears that placeholder only works with the multiple attr set.

  • allanallan Posts: 63,470Questions: 1Answers: 10,467 Site admin
    1. There isn't one in the Editor documentation - it applies the attributes to the select element, so whatever that element can take will work.
    2. The latest version of 4.x.
    3. Actually no - we've not yet published public examples of the plug-ins with Editor. That it something that we need to do.

    Allan

  • rboudwinrboudwin Posts: 28Questions: 6Answers: 1
    1. I'm looking at the select element documentation and don't see a list of attributes:
      https://editor.datatables.net/reference/field/select
  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    From the example page you linked to:

    The full Editor reference documentation is available to registered users of Editor - the information shown below is a summary only.

    In other words, you must be logged in to see the full Editor documentation.

  • rboudwinrboudwin Posts: 28Questions: 6Answers: 1
    edited December 2018

    I am logged in and a registered user of Editor.

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    You should be able to see this:

    Set HTML attributes on the select element.

  • rboudwinrboudwin Posts: 28Questions: 6Answers: 1

    I see it now. Thank you!

    Maybe I should have posted my questions separately so that I could check Answered for each one.

This discussion has been closed.