TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2.1k
479.7k
Dropdownlist is not working on my DataTable?
Feb 17 2020 7:30 AM
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>
Reply
Answers (
3
)
How to do dropDownlist using DataTable on Jquery?
Google webmaster tool issues