var options = ""; for(var i=0; i < columns.length; i++) { if( columns[i].data != null && columns[i].data != undefined) { options += " "+ columns[i].data +" "; } }$('#role').html(options);
Hi,
Please refer to the official Select2 Docs to programmatically control Select2.
Regards.
Please enter your email and we will send a link to your email to reset your password