Inquiry on .scrollTo

Inquiry on .scrollTo

helpmenothelpmenot Posts: 4Questions: 3Answers: 0

This line of code is perfectly working dt.row(150).scrollTo();
but when I increased it dt.row(200).scrollTo(); it wont scroll,
please tell me what am I missing?

This question has an accepted answers - jump to answer

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119
    Answer ✓
  • helpmenothelpmenot Posts: 4Questions: 3Answers: 0
    edited June 2017

    Hello @bindrid it worked!
    I tried adding it as a separate line of code and assigned a static row index.

    But when I included it in an if statement its not being hit.

                       $('#tblMaster td').each(function (e) {
                        var cellText = $(this).html();
                        if (cellText == 'xxxxxxx') {
                            var rwIdx = $(this).closest('tr').index();
                            dt.scroller().scrollToRow(rwIdx);
                        }
    

    It is looping upto 250 rows only. Is that a limitation for datatables?
    Sorry newbie problems :neutral: !

  • allanallan Posts: 64,757Questions: 1Answers: 10,717 Site admin

    No. DataTables has no hard limits. If its only looping that many, it suggests that there are only 250 cells matched by '#tblMaster td'.

    Perhaps you need to use cells().nodes() to get the nodes that are present in the table.

    Allan

This discussion has been closed.