How do I scroll to a specific column?

How do I scroll to a specific column?

Aaron MattsonAaron Mattson Posts: 1Questions: 1Answers: 0

It looks like this question has been asked a number of times before, but the discussions are all closed with no response. Please let me know if this is possible. I'm trying to do it in the columnDefs[createdCell...] function.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Scrolling to a column would be done with jQuery.scrollLeft(). Use column().node() to get the header node for the column in queston so you can use jQuery.position() to get the scroll value.

    I would strongly recommend against doing it in -ini columns.createdCell though. It would trigger multiple times for every draw.

    Allan

  • tomasjuareztomasjuarez Posts: 5Questions: 2Answers: 0

    Hello! I know this post is very old, but I have the same problem.
    Could you please put an example?
    I tried a lot of options, but I can't make it works.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @tomasjuarez ,

    It would be worth posting what you've tried so far as a starting point. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.