AutoFill 2.1.2 - How to get the the offset value with scrollX enabled.

AutoFill 2.1.2 - How to get the the offset value with scrollX enabled.

glendersonglenderson Posts: 231Questions: 11Answers: 29

I upgraded to Autofill 2.1.2 and dataTables 1.10.12 and that resolved an issue I had with the position of the handle not taking into account the offset or scrollX value - Thank You!

However, is there a mechanism to obtain the offset value of the scrollX of the scroll body? Upon clicking a cell, I overlay an input box and it's getting positioned incorrectly because I cannot figure out how to adjust for the scrollX value when it's not zero. I'm not sure which element I should be considering for the offset or if there's a built in function that can provide that value.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    There isn't any built in method for that in DataTables. But you should be able to use jQuery to do it. Something like $('div.dataTables_scrollBody').scrollTop().

    Allan

  • glendersonglenderson Posts: 231Questions: 11Answers: 29
    edited June 2016 Answer ✓

    Thanks Allen, after reviewing your answer I used editEvent.offsetparent().scrollLeft() where editEvent is the parent of the click event, and it all seems to render correctly now.

This discussion has been closed.