Hi Mates
I have DataTable with data and want to create dropdownlist to inside, but its not working. Kindly please help me and here is my logic below;.
- <link href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css" rel="stylesheet" />
-
-
- @section scripts{
-
- <script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
-
-
- <script>
-
- $(document).ready(function () {
-
- $("#EventsManagementsTable").DataTable({
-
- "columnDefs": [
- { "width": "5%", "targets": [0] },
- { "className": "text-center custom-middle-align", "targets": [0, 1, 2, 3, 4, 5, 6] }
-
- ],
-
- "serverSide": "true",
- "order": [0, "asc"],
- "processing": "true",
- "language": {
- "processing": "processing...... please wait"
- },
-
-
- "ajax": {
- "url": "/Dashboard/GetData",
- "type": "POST",
- "datatype": "JSON",
- "columns": [{
- "data": "WhoAttend",
- "name": "WhoAttend",
- "render": function (data, type, full) {
- return '<select id= "dynamic_select" name= "dynamic_select">' +
- '<option id= "0" value= "TrainingType">Select</option>' +
- '<option id= "1" value= "TrainingDescription">Select</option>' +
- '<option id= "2" value= "Price"></option>' +
- '<option id= "3" value= "Value"></option>' +
- '<option id= "4" value= "Facilitator"></option>' +
- '<option id= "5" value= "WhoAttend"></option>' +
- '<option id= "0" value= "RSVP"></option>' +
- '</select>';
-
- },
-
- }],
-
- },
- "columns": [
- { "data": "TrainingType", "name": "TrainingType" },
- { "data": "TrainingDescription", "name": "TrainingDescription" },
- { "data": "Price", "name": "Price" },
- { "data": "Venue", "name": "Venue" },
- { "data": "Facilitator", "name": "Facilitator" },
- { "data": "WhoAttend", "name": "WhoAttend" },
- { "data": "RSVP", "name": "RSVP" },
-
- ]
-
-
- });
-
-
- });
-
-
-
- </script>