Initial live dom sorting issue

Initial live dom sorting issue

frenzyfrenzy Posts: 21Questions: 0Answers: 0
edited February 2011 in General
Hi,

I am using the live dom sorting plugin for input fields (http://www.datatables.net/examples/plug-ins/dom_sort.html), and it works fine except for initial sorting.

The datatable is initialized like this:
$('#datatableId']').dataTable( {
"aoColumns" : [ { "sSortDataType" :"dom-text"},
{ "bSortable" :false },
{ "bSortable" :false }
],
"aaSorting" : [[ 0, 'asc' ]]
});

I want the table initially to be sorted by the first column asc, which is an input field column. As i said, it works when clicked on the sort header, but it fails to sort initially.

Thanks

Replies

  • frenzyfrenzy Posts: 21Questions: 0Answers: 0
    So, am I doing something wrong or is this a bug? I could workaround this by triggering click on the column header which i want to sort on when the page loads, but is this the only solution?

    Thanks
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    I don't see anything obviously wrong. Could you please a link to an example showing the issue please? I've just tried doing an initial sort on one of the DOM sorted columns in my example and it seems to work okay.

    Allan
  • frenzyfrenzy Posts: 21Questions: 0Answers: 0
    Thank for the response. I found out the problem was because i have put the sort plugin functions inside $(document).ready(), tho i have no clue why it does not work that way also. Could you be kind enough and make me clear about this behaviour?
This discussion has been closed.