How to add drop down list in jquery datatable
How to add drop down list in jquery datatable
Hemangi
Posts: 4Questions: 2Answers: 0
I have jquery plugin and i want to add drop down list in datatable and display data from database
This discussion has been closed.
Answers
Ok, try initiating a table, then adding a dropdown list inside the table..
Were here to help you with DT related peoblems, not walk you theough the entire process or teach you how to build it from scratch, thats what the documentation is fo, sorry bud.
If youre stuck on something inparticular, related to DataTables, then let me know.
List<Trans> list = null;
DataTable dataTable = new DataTable();
String temp = (String) request.getParameter("days");
switch(temp)
{
case "D" :
list = DAO.getAllTransactions();
break;
case "W" :
list = DAO.getWeeklyTransaction(temp);
break;
I tried above code in servlet (create DAO class object and call java method) and i get data in JSON string and in jsp page i called (in anchor tag of dropdown list) href="/Admin_Dashboard/displayData?days=W" but i can't display data in jquery datatable while click on dropdown list
.... again, this has nothing to do with datatables.
I have been trying to figure out how to do the same thing for quite some time now; any luck yet or have you found any additional resources on this topic?
If you move to creating your own ajax page, then you can craft anything to be returned in the json data that you send back to dataTables.
you can then send
{"data":[ ..., "<select><option val=\"1\">Pick 1<option>Pick 2<option>Pick 3</select>" ...}"
dataTables will render HTML that's been passed in the json data.
Can you reference a resource with a complete example that is easy to understand? Thanks.