Skip to content Skip to sidebar Skip to footer

How To Set Multiple Selected Values For Multi-select Picker?

I have the following multi-select picker which is populated with data. I want to be able to set multiple selected values that I get from the database.
, data: { 'id': selectedEvent.id }, success: function (data) { console.dir(data); let optArr = []; for (var i = 0; i < data.length; i++) { optArr.push(data[i].Skill.Id); } $('.selectpicker').selectpicker('val', optArr); $('.DDLSkills').selectpicker('refresh') }, error: function (error) { alert('Failed'); } })

Post a Comment for "How To Set Multiple Selected Values For Multi-select Picker?"