sorting_desc class not removed

sorting_desc class not removed

jpbrucklerjpbruckler Posts: 3Questions: 0Answers: 0
edited September 2009 in General
Not sure if this is a bug, or an unfortunate side effect of the way I have to use this plugin, but the sorting_XXX classes aren't being removed after subsequent sorts.

For example, a column that is sorted ascending to start with starts with class sorting_asc. When clicking the header to sort the column descending, I would expect sorting_asc to be removed, and sorting_desc be added; vice verse when clicking the header to sort again.

What I'm getting is this, when clicking an already sorted column heading, the sorting_XXX class is added to the HTML element, but the previous sorting_XXX class is not removed.

I can tell you the following about my environment:
jQuery version: 1.3.2
DataTables version: 1.5.2
Running jQuery in noConflict mode, as I'm using this within a DokuWiki installation. In addtion, the jQuery library, the DataTables plugin, and my header code has all been combined into 1 JS file. Not ideal, but until I rewrite a DokuWiki plugin to handle this situation, it's what I've got.

Header code:
[code]
jQuery.noConflict();
jQuery(document).ready(function($) {
$('.updates__sortable').dataTable(
{
"sPaginationType" : "full_numbers"
}
);
});[/code]

As I can't be sure that this isn't a side effect of my environment, I thought it best to put this into the general discussion category. Thanks, both for your time, and this plugin which has saved me countless hours!

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi jpbruckler,

    Sounds like a very odd bug. Thanks for the detailed description and information about the issue - it answers a lot of the questions I would have posed!

    I've just tried testing this with my local version, and also the table on the DataTables.net home page, and it appears to be working as expected. Could you confirm that the table at http://datatables.net/ also works for you? The only thing that I can think of that would cause this is a JS error - but I can't think of anything that would cause that to happen!

    Is there any way you can post a link to an example which is showing the problem in action (or send it to me direction if you don't want to make it public: http://datatables.net/contact ).

    Regards,
    Allan
  • jpbrucklerjpbruckler Posts: 3Questions: 0Answers: 0
    Thanks for the quick reply Alan.

    I'd love to be able to give you a URL, but I'm working on an intranet (a fact I apparently neglected to mention in my first post).

    In answer to your question, it works perfectly @ http://datatables.net. I can watch the classes change in firebug. I'll go through everything that I'm doing again, it's most likely there. I thought perhaps I had missed a patch or stumbled on a known issue. It will probably be tomorrow afternoon before I will be able to post back with any certainty.

    Again, thank you for your time.
  • jpbrucklerjpbruckler Posts: 3Questions: 0Answers: 0
    I got bored tonight so I VPNed into work to get my code and was fiddling with it at home (sad, huh?).

    I refactored the plugin I wrote for DokuWiki to load jQuery and it's working now. Which is really odd, but I guess I'll take what I can get.

    Anyway, sorry for wasting your time, and thank you for an incredibly useful plugin.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi,

    Sounds good - glad to hear it works as expected :-)

    Allan
This discussion has been closed.