How to fill select box to jquery datatable?
How to fill select box to jquery datatable?
yushka
Posts: 1Questions: 1Answers: 0
I am using jquery datatable and angularJS.
I have the table
table#reception_issues.table.display(cellspacing='0', width='100%')
thead
tr
th #
th Date
th Issue
th Author
th Support group
th
th
tfoot
tr
th #
th Date
th Issue
th Author
th Support group
th
th
and script for datatable
script(type='text/javascript').
$(document).ready(function () {
$('#reception_issues').DataTable({
"ajax": "http://localhost:4444/data2.json",
"columns": [
null,
null,
null,
null,
{
"data": null,
"defaultContent": "<select id='setGroupOfSupport' class='form-control' ng-model = 'selectedGsqroupOfSupport' ng-options = 'group as group.item_name for group in listOfGroupSupport'></select>"
},
{
"data": null,
"defaultContent": "<button ng-click='changeResponsibleGroupOfSupport' class='form-control btn btn-primary'>Change group</button>"
},
{
"data": null,
"defaultContent": "<button ng-click='acceptIssue' class='form-control btn btn-primary'>Accept</button>"
}
]
});
});
and my test JSON file
{
"data": [
[
"2346",
"2015-20-03",
"Issue 1",
"Business 1"
],
[
"2545",
"2015-20-01",
"Issue 2",
"Business 2",
],
[
"1235",
"2015-20-02",
"Issue 3",
"Business 3"
],
[
"9800",
"2015-20-04",
"Issue 4",
"Business 4"
]
]
}
SELECT box should contain a list: Business 1, Business 2, etc.
Can I fill select box in datatable using AngularJS ? How I can fill select box in datatable?
This discussion has been closed.