Using a placeholder and clearing the select2

Hi folks,

tried to set a place holder for my select2:

        placeholder: "Select a Connection",
        allowClear: true

This however does not work and select selects the first option automatically…

Second I tried to clear the selected option in js:


As well did not work.

Any hints how to do it?


Ok. Seems I have found a solution. No problem with implementation. To add a placeholder you have to include in your html velocity template a empty <option> first.