1

I have a datatables driven table setup, which has a couple hidden columns in it. From which I am trying to figure out how to find the last row of that table with a specific class. So I can then take the first column of it which is one of the hidden columns and use its data for a part of another script I am writing. As I understand it fnGetData() is the function I am looking to use. But finding the last row (tr) with a specific class (which there are multiple rows with that class). Then using that row as a means to get the data from that first hidden column so I can work with it seems to be evading me.

I need an idea of how to find that last row, and use it the way that is hoped. Any idea's? Also outside of the methods found on the datatables api docs, I haven't tried much outside of that yet.

2 Answers 2

1

Made a quick and simple jsFiddle of how I understood your table to work; and the jQuery I used:

$(".row:last td:hidden:first").text()
Sign up to request clarification or add additional context in comments.

Comments

0

Something like this should work for you. Use the :last selector.

$(".trclass:last").children(".hiddenCol") .....

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.