Load data on Select2 | Jquery

krixnaas

Krixnaas

Posted on April 29, 2022

Load data on Select2 | Jquery
var data = [{ id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2, 

    text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' }];

    $("#controlID").select2({
      data: data
    })
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
krixnaas
Krixnaas

Posted on April 29, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related