Unwanted change of sorting when resizing the window
Unwanted change of sorting when resizing the window
majkelju
Posts: 3Questions: 0Answers: 0
I open the table in a new window. I sort the data via SQL, so I got initial sorting set to false, sorting on all columns forbidden, but when I grab the edge of the window and I start to resize it, the datatables change the sorting of the data. I searched the documentation but with no result. Is this some sort of bug or am I doing something wrong?
This discussion has been closed.
Replies
Allan
btw: In this case it seems that table is against my will sorted according the "Cena [Kč]" column.
this is how I open a new window with the table:
[code] function displayCalculation(){
$("#modalCalc").load('./safe/kalkulace_CalcVzorec.php?k_polozka=<?echo $k_polozka;?>').dialog({modal:false, title:'Kalkulační vzorec', width:"auto", height:"auto"});
}[/code]
HTML table:
[code]
echo '';
echo '
Typ potřeby
Cena [Kč]
Procent
';
while($row = $result->fetch_assoc()){
echo ''.$row['popisTypu'].'';
echo ''.number_format($row['mnozstvi'],'2','.',' ').'';
echo ''.number_format($row['mnozstvi']/($celkMnozstvi/100),'2','.',' ').'';
}
echo '';
[/code]
DataTable script:
[code]
iHeight = tableCalc.offsetHeight;
var oTable;
$(document).ready(function(){
oTable = $('#tableCalc').dataTable({
"bJQueryUI": true,
"sDom": '<"H"f>rtS<"F"i>',
"sScrollY": iHeight+50,
"bFilter": false,
"bAutoWidth": true,
"aaSorting":[],
"bSorted": true,
"bPaginate": false,
"bRetrieve":true,
"aoColumns": [
{ "sClass": "odsazeni", "sType": "czech", "bSortable":false,"sSortableNone": "ui-state-default" },
{ "sClass": "odsazeni", "sType": "natural", "bSortable":false,"sSortableNone": "ui-state-default" },
{ "sClass": "odsazeni", "sType": "natural", "bSortable":false,"sSortableNone": "ui-state-default" }
]
});
});
[/code]
As far as I'm aware from your code it should work fine.
Allan