I am trying to populate a drop-down box which I have created in the Data-Tables plug-in for JQuery.
The code I have used is:
var oTable = $('#reqAllQueriesTable')
.dataTable(
{
"sDom": '<"H"<"tools">lfrt>',
});
$("div.tools").html('Organize by Teams: <select id="booking_status"><option value="">Teams</option><option value="team1">Team 1</option><option value="team2">Team 2</option></select>');
I want to replace the static contents of select in HTML by the content by a List of objects in my Java code.
Is this possible by replacing the existing code? If yes, how can the Java object be used in this code.
Please help.
Got the answer.
I pass a model attribute from my java code which calls the JSP:
Then in jQuery Data Table, I overwrite the DOM to call a
divnamedmyTools:The div which creates the drop-down list looks like: