DisplayIndex Issue/ Bug with 1.10.0-beta.3.dev version
DisplayIndex Issue/ Bug with 1.10.0-beta.3.dev version
Hi, i was previously using 1.10.0-beta.3.dev version of Datatables and it worked perfectly. I recently upgraded it to 1.10.7 version and find some issues.
In my code, i have appended 2 extra filtering dropdowns for the data in the table which works perfectly. When i changed the "aLengthMenu" it would work fine in previous version, But now when i change it, the dropdown values are getting reset. Also i use another faeture where in i hide/ unhide the columns based on filtering. It throws an "error saying style is undefined".
Any help on the issue will be appreciated. The Code is as follows:
"var demoTable = $('#example').dataTable(
{
"bJQueryUI": true,
"sScrollY": "400px",
"sPaginationType": "full_numbers",
"aLengthMenu": [20, 50, 100],
"iDisplayLength": 20,
"bProcessing": true,
"bDeferRender": false,
"iDisplayEnd": 20,
"StateSave": true,
"ajax": function(data, callback, settings) {
datatableAjaxRequest(callback, uri);
},
"columns": [
{sWidth: "1%", sTitle: " ", "data": "ImageString"},
{sWidth: "4%", sTitle: "", "data": "a"},
{sWidth: "10%", sTitle: "A1", "data": "b"},
{sWidth: "8%", sTitle: "A2", "data": "c"},
{sWidth: "11%", sTitle: "A3", "data": "d"},
{sWidth: "10%", sTitle: "A4", "data": "e"},
{sWidth: "13%", sTitle: "A5", "data": "f"},
{sWidth: "12%", sTitle: "A6", "data": "Recipient"},
{sWidth: "10%", sTitle: "A7", "data": "g"},
{sWidth: "20%", sTitle: "A8", "data": "h"},
{sWidth: "4%", sTitle: "A9", "data": "i"},
{sWidth: "0%", sTitle: "A10", "data": "j", "visible": false},
{sWidth: "0%", sTitle: "A11", "data": "k", "visible": false}
],```
"oLanguage": {
"sInfoEmpty": 'No matching records found to list.',
"sEmptyTable": "No matching records found to list.",
"sSearch": "",
"sLoadingRecords": "<div class=\"loader \"><img src='images/general/ajax-loader.gif' style=\'" + padding + "'\"></div>",
},
aoColumnDefs: [{
'bSortable': false,
'aTargets': [0]
},
{
"aTargets": [3, 5],
"mRender": function(data, type, full) {
if (data === '') {
return '';
}
else
return '<a href="#">' + data + '</a>';
}
},
{
"aTargets": [1],
"mRender": function(data, type, full) {
if (data === '') {
return '';
}
else
data;
var Status = '';
for (var i = 0; i < Statuses.length; i++)
{
if (Statuses[i].Acronym == data)
{
Status = Statuses[i].StatusName;
}
}
return '<span style="display: none;">' + Status + '</span>' + data;
}
}
],
"fnRowCallback": function(row, data, iDisplayIndex) {
if (data.StatusName == "New (Ext)")
{
$(row).addClass('new_selected');
}
if (data.ReservationID == selectedResvId)
{
$(row).addClass('selected');
var pgno = iDisplayIndex / 20;
pgno = parseInt(pgno);
if (pgno >= 0)
{
selectedIndexPage = pgno;
}
}
},
"fnInitComplete": function() {
if (selectedIndexPage > 0)
{
var table = $('#example').DataTable();
table.page(selectedIndexPage).draw(false);
}
},
"oSearch": {"sSearch": selectedIndexSearch},
});
var table = $('#example').DataTable();
if (chosenFilterID == 3)
{
table.column(10).visible(true);
}
else
{
table.column(10).visible(false);
}
"
Replies
Can you link to the page you are working on, or create a test case using JSFiddle showing the issue please?
Allan