Getting data from a particular column of a filtered data set

Getting data from a particular column of a filtered data set

kevins1966kevins1966 Posts: 6Questions: 4Answers: 0

Hi all,

I have an asp.net core application using DataTables with filters, paging and a button to export the data.

If there are more records in the dataset than appear on the current page then the export only includes those displayed on the current page.

I can see that I can get a list of the rows in the filtered data set using table.rows({ filter: 'applied' }).data() and so figured I could use that to get a list of the id's of the filtered dataset to send to the controller action.

However that produces a list of every property on the object.

How do I just get at the data and, more specifically a particular column from the dataset?

table.rows({ filter: 'applied' }).column(0).data() appears to be getting there in that it gets data for the first columns but again this includes all the object data not just the values I am after.

Thanks in advance for any advice.

Answers

  • kthorngrenkthorngren Posts: 21,322Questions: 26Answers: 4,948

    If there are more records in the dataset than appear on the current page then the export only includes those displayed on the current page.

    Sounds like you have enabled server side processing. See this FAQ.

    How do I just get at the data and, more specifically a particular column from the dataset?

    Use pluck().

    Kevin

Sign In or Register to comment.