Cannot preload select2 with Datatable object
Cannot preload select2 with Datatable object
I am using a backend server to fetch a list of objects. Inside my object i have a field which is an Array with jsonObjects in the form of [{value:"1", label:"Label1"}, {value:"1", label:"Label1"}, {value:"1", label:"Label1"}]. When i click on the Edit button of the Datatable i want the Select2 component to have some preselected values (which is different for each row and i dont know how to inform Select2 for it) and when click Save i want the labels to be shown in the Datatable. Is there any example with that exact senario because i dont find something like that.
Answers
Problem solved by overriding the render function of my select column