A selector for rows from X to Y?
A selector for rows from X to Y?
Tablefak
Posts: 35Questions: 8Answers: 0
Say my table displays 10 rows. I can select them like this:
datatable.rows({"search": "applied"})
How do I further filter out rows from 3rd to 5th in this set, for example?
I tried using .splice
, but it doesn't return an Api
instance which I could further operate on.
I also tried using .filter
, but my callback doesn't get called for every row (as I expected). Instead, it's only called once with a value like this:
This question has an accepted answers - jump to answer
Answers
I was able to solve it like this:
But I'm wondering if there's a more elegant way.
Maybe use
rows().indexes()
. This example usessplice()
to get the desired range of row indexes.https://live.datatables.net/qehubozu/2/edit
Kevin
Hi, Kevin. Your code does what I want and is more elegant. Thank you.