I am using datatable in angular, I want to bind the with datatable.

I am using datatable in angular, I want to bind the with datatable.

pradipsolacepradipsolace Posts: 1Questions: 1Answers: 0

I am using datatable in angular, I want to bind the <ng-select> with datatable. I want to do it usign dynamic creation of HTML.
Here is the my simple <Select> tag code. how I can convert it into the <ng-select>

{
title: 'Assigned To',
data: 'assignedTo',
class: '',
type: 'select',
width: 136,
orderDataType: "dom-select",
render: function (data: any, type: any, dataToSet: any) {
if (dataToSet.assignedTo) {
let options = "<select class='form-control' id='AssigneForTask' data-taskId=" + dataToSet.id + " >"
for (let i = 0; i <= vm.employeesArr.length - 1; i++) {
options = options + "<option irr=" + vm.employeesArr[i].id + " value=" + vm.employeesArr[i].employeeName + " " + (dataToSet.assignedTo.toLowerCase() === vm.employeesArr[i].employeeName.toLowerCase() ? 'selected' : '') + " > " + vm.employeesArr[i].employeeName + "</option>"
}
options += "</select>";
return options;
}
}
},

Sign In or Register to comment.