style issue while loading data to datatable
style issue while loading data to datatable
kumarmca.upp
Posts: 7Questions: 1Answers: 0
this is my datatable, im dynamically loading data
var datatableVariable = $('#table_id').DataTable({
//colReorder: true,
//lengthMenu: [
// [10, 25, 50],
// ['10 rows', '25 rows', '50 rows']//, 'Show all'
//],
paging: false,
//"bPaginate": true,//24-apr
//"bAutoWidth": true,
"filter": false,
destroy: true,
searching: false,
"data": res ,// MY DATA
"aoColumnDefs": aryJSONColTable,
"aoColumns": aryJSONCollumn,
//dom: 'Bfrtip',
//dom: 'lBfrtip',
buttons: [{
extend: 'csv',
text: 'To CSV',
},
//{
// extend: 'copy',
// text: 'To clipboard'
//},
{
extend: 'excel',
text: 'To Excel',
}, ]
});
my html
@model Anglian.ViewModel.UserModel
@{
ViewBag.Title = "DataTable";
Layout = "~/Views/Layouts/_LayoutPostLogin.cshtml";
}
Reports
Select a Category User Management Error Logs Usage Select a Report @*
@*style="display:none"*@
@*style="height:200px"*@
This discussion has been closed.
Replies
What exactly is your problem?
$('#btnSQLSubmit').click(function () {
var datatableVariable = $('#table_id').DataTable();
datatableVariable = $('#table_id').DataTable({
data": res,
"aoColumnDefs": aryJSONColTable,
"aoColumns": aryJSONCollumn
});
});
datatable not reinitialising here....dynamically loading different tabels...but if column changing times exixting table should destroy...but here not
Can you link to a page showing the issue so it can be debugged please?
Thanks,
Allan