Reputation: 95
function unenroll(){
var myTable = $('#enrollment_info').DataTable();
alert("all data is "+allData);
var selectedrows = myTable.rows('.selected' ).data();
alert("selected rows"+selectedrows);
alert("selected rows length is "+ selectedrows.length)
}
selected rows is showing output but in object format. How can I get it in String format. This table gets populated by a json from Servlet.
Upvotes: 0
Views: 1289
Reputation: 61
JSON.stringify(); is one direct solution if I'm understanding your question correctly. You should probably decide exactly what data you need from the table and be a bit more direct about retrieving it.
function unenroll(){
var myTable = $('#enrollment_info').DataTable();
alert("all data is "+allData);
var selectedrows = JSON.stringify(myTable.rows('.selected' ).data());
alert("selected rows"+selectedrows);
alert("selected rows length is "+ selectedrows.length)
}
Upvotes: 2