aLengthMenu breaks when I add aaSorting
aLengthMenu breaks when I add aaSorting
I am using the code below. it works fine, I have a nice table with alternating colored rows and a search box. user can sort fine after loading page. However I want to add an initial sort. I added a aaSorting entry but when I do that following break: sorting, search box, alternating row colors. Is aaSorting and aLengthMenu/iDisplaylength not compatibility?
[code]
$(document).ready(function() {
$('#example').dataTable({
"iDisplayLength": -1,
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]
});
} );
RQ
XDM
<?php echo $row_rs_udm['RA']; ?>
<?php echo $row_rs_udm['fieldz']; ?>
<?php echo $row_rs_udm['fieldc']; ?>
<?php echo $row_rs_udm['description']; ?>
.......
[/code]
[code]
$(document).ready(function() {
$('#example').dataTable({
"iDisplayLength": -1,
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]
});
} );
RQ
XDM
<?php echo $row_rs_udm['RA']; ?>
<?php echo $row_rs_udm['fieldz']; ?>
<?php echo $row_rs_udm['fieldc']; ?>
<?php echo $row_rs_udm['description']; ?>
.......
[/code]
This discussion has been closed.
Replies
Allan
[code]
Untitled Document
<!-- Needed for jquery table support --->
<!-- Not sure if this sheet is really used, I think this is only used when bjQuertyUI is true -->
<!--
-->
$(document).ready(function() {
$('#example').dataTable({
"aaSorting": [[1,'asc'], [2,'desc']]
"iDisplayLength": -1,
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]
});
} );
HEAD
HEAD2
A
B
C
D
[/code]
[code]
"aaSorting": [[1,'asc'], [2,'desc']]
"iDisplayLength": -1,
[/code]
It's missing a comma after the aaSorting. So you want:
[code]
"aaSorting": [[1,'asc'], [2,'desc']],
"iDisplayLength": -1,
[/code]
Allan