Select 2 bootstrap when dynamically load data
Hi Team,
We’re using Select2 for our dropdowns, and we’ve enabled users to add rows dynamically in the form. We were using select2 on those rows. However, when new rows are added, the Select2 dropdowns do not initialize correctly for the dynamic data.
Could you please look in to it?
Thanks!
Replies (1)
Deleted comment
Deleted comment
Deleted comment
Deleted comment
Hi,
You will need to reinitialize Select on the new rows that have been added. Select2 instances must be initialized once they are added to DOM. You can call KTComponents.init() after new rows are populated so you can initialize newly added Select2 instances.
For more info please check Metronic Docs.
Regards