views:

11

answers:

0

Hi

I have a datatable that has sorting enabled.

It seems though if I try to delete a row then add the new version of that row. Or just try to update that row no sorting will be done on this new/updated row. It is like it is not part of the sort anymore. If I click on the column that row will either be the first or last row. It is like it does not even try to sort it.

var position = dbTable.fnGetPosition(row);
dbTable.fnUpdate([my columns], position);

So I get the position and then do an update. The data gets updated an a success msg is returned yet when I try to sort it does not sort.

It seems to happen with the add method too. Is it something to do with my dates?

I have 2 columns that use a hidden column to sort. I am using iDataSort and the dates look like this

07/19/2010 4:04 PM
07/16/2010 4:04 PM
07/18/2010 2:01 PM
07/22/2010 4:04 PM
07/23/2010 4:04 PM
07/30/2010 4:04 PM

So the top one(19th) is the one I added it add's it on the top. If I hit the sort column my hidden column should be sorted and it seems to be using that column

07/30/2010 4:04 PM
07/23/2010 4:04 PM
07/22/2010 4:04 PM
07/18/2010 2:01 PM
07/16/2010 4:04 PM
07/19/2010 4:04 PM

That is the result. See how the 19th just goes right to the bottom. If I refresh the page then it is all sorted in correct order

07/16/2010 4:04 PM
07/18/2010 2:01 PM
07/19/2010 4:04 PM
07/22/2010 4:04 PM
07/23/2010 4:04 PM
07/30/2010 4:04 PM 

   var realIndexSort = $('#ColumnThatShouldBeSorted').index();
    DataTable = $(this).dataTable
        ({ 
            "aaSorting": [[realIndexSort, "asc"]],
            "bJQueryUI": true,
            "sPaginationType": "full_numbers",
            "oLanguage": 
                {
                    "sZeroRecords": "Default msg"
                }, 
            "aoColumns":
                [
                    { "bSortable": false, "bSearchable": false }, 
                    null, 
                    null, 
                    null,
                    { "bSortable": true, "bSearchable": false }, 
                    { "iDataSort": realIndexSort, "bSearchable": true }, 
                    { "iDataSort": realIndexSort },
                    null, 
                    { "bSortable": false, "bSearchable": false }, 
                    { "bSortable": false, "bSearchable": false }, 
                    { "bSortable": true, "bSearchable": false } 
               ]

        });