How could I get the particular column data in a rows('.select') object?
How could I get the particular column data in a rows('.select') object?
![gonghai](https://secure.gravatar.com/avatar/93732f00fab3f3f20ca04e83c6297928/?default=https%3A%2F%2Fvanillicon.com%2F93732f00fab3f3f20ca04e83c6297928_200.png&rating=g&size=120)
Link to test case: https://datatables.net/examples/api/select_row.html
Debugger code (debug.datatables.net): none
Error messages shown: none
Description of problem: On the official page: https://datatables.net/examples/api/select_row.html
It says I can use .rows() to get the context object.
So I picked these following rows:
However, If I want to get all the names in an array, in this particular case, like:
["Angelica Ramos", "Brielle Williamson", "Bruno Nash"]
This question has an accepted answers - jump to answer
Answers
You can use
pluck()
to get that name field - see the examples at the end of that reference page,Colin
colin, thanks a lot. you are my hero!:)
oh, sorry , just one thing.
After calling pluck(), how can I retrieve the data as an array?
It seems the pluck() still returns a DT object.
Try![:smile: :smile:](https://datatables.net/forums/resources/emoji/smile.png)
toArray()
. Checkout theDatatables Utility
section of the API docs for more fun APIsKevin