Giter VIP home page Giter VIP logo

Comments (5)

kylefox avatar kylefox commented on September 8, 2024

Out of curiosity, what is your solution doing that seems wrong? I seems like it should work...

Probably the best thing to try is binding to the custom "click.tablesort" event on the th you want disabled, and then preventing the event. I believe the method you want is event.stopImmediatePropagation(), so something like:

$('th.type-null').on('click.tablesort', function (event) {
    event.stopImmediatePropagation();
    return false; // May not need the return statement.
});

To be honest it's been a while since I used this plugin, so you'll probably need to experiment a bit and dig into the plugin code!

from jquery-tablesort.

tsquillario avatar tsquillario commented on September 8, 2024

Yea I started looking through the code last night. I got the disable column working the way I wanted it to.

I am running into an issue with Chrome and sorting a column with all the same values. You'd think that it just wouldn't sort since every value was the same. I made a demo in jsFiddle to demonstrate the issue. This only happens in Chrome, not Firefix. Do you think it has to do with the string comparison differences between browsers. I tried .trim() and toLowerCase(), neither made a difference.

http://jsfiddle.net/nAMbs/1/

from jquery-tablesort.

kylefox avatar kylefox commented on September 8, 2024

Yea I started looking through the code last night. I got the disable column working the way I wanted it to.

Cool. Mind sharing how you ended up doing this?

Regarding your jsFiddle, I see what you mean. The internal sort method does indeed return 0 for each item in the column with similar values, so it's not related to how the browsers are comparing things.

The only thing that comes to mind is maybe Chrome iterates over the rows in a different (and unexpected) manner than Firefox does, and as a result re-appends the tr elements in a weird order.

from jquery-tablesort.

tsquillario avatar tsquillario commented on September 8, 2024

I ended up bailing and going with https://github.com/joequery/Stupid-Table-Plugin it was able to get around the Chrome/FF issue.

from jquery-tablesort.

kylefox avatar kylefox commented on September 8, 2024

Okay, good to know -- thanks for the link!

from jquery-tablesort.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.