This topic contains 1 reply, has 2 voices, and was last updated by Sean Sean 2 years, 1 month ago.

multiple select2 in modal not working


  • ketil
    Participant

    Posts: 3
    Member Reply #4249

    Hi,

    After upgrading to latest version of metronic I am not able to get my multiple select2 working on modal.

    This is working


    <div class="modal-header">
    <h4 class="modal-title">Innstillinger - Tilvalgsgrupper</h4>
    </div>
    <form class="form-horizontal" method="post">
    <div class="modal-body">
    <div class="form-group">
    <label class="control-label col-md-4" for="eventCategoriesSelectList">Velg hvilke tilvalgsgrupper som skal vises i oversikten.</label>
    <div class="col-md-8">
    <select id="eventCategoriesSelectList" class="form-control select2-multiple" name="person_settings[eventCategories][]">
    <option value="62">Seminarer</option>
    </select>
    </div>
    </div>
    </div>
    <div class="modal-footer">
    <input name="action" type="hidden" value="savePersonPageSettings" />
    <input name="content" type="hidden" value="admin_event" />
    <button class="btn default" type="button" data-dismiss="modal">Avbryt</button>
    <button class="btn green" type="submit">Lagre</button>
    </div>
    </form>`

    https://www.dropbox.com/s/e254acgd38d7yyg/Screenshot%202015-12-26%2013.50.01.png?dl=0

    If I add multiple to the select tag this happens (no other changes):

    https://www.dropbox.com/s/i4qd6rnu3scs2s3/Screenshot%202015-12-26%2013.53.19.png?dl=0

    As far as I can see from the demos this should be working fine, any input? If I try to manually init select2 it all goes wrong.

    • This topic was modified 2 years, 1 month ago by  ketil.
    Sean
    Sean
    Keymaster

    Posts: 4226
    Support Staff Reply #4258

    Hi,

    Since Metronic v4.5.x we updated to Select 4.x which has some breaking change comparing to Select 2.x. Please try to check the latest Select2 version here¬†https://select2.github.io/examples.html and adjust your select2 related code following the latest version’s changes.

    Thanks.

Tagged: 

You must be logged in to reply to this topic.