Showing count for the Individual column searching

Showing count for the Individual column searching

maximamaxima Posts: 2Questions: 1Answers: 0

Hello guys,

Is it possible to show the number of contents for the filtering menu?!

Same is the photo:
(https://datatables.net/forums/uploads/editor/mv/7kfaqju1guxr.png "")

For this example:
https://datatables.net/examples/api/multi_filter_select.html

This question has an accepted answers - jump to answer

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi maxima,

    You can access the number of unique values in the column using column.data().unique().toArray().length inside the loop of that example that adds the options. After that it is up to you to choose how you want to display that.

    I've made a wee example showing this that just prints the number of unique entries in each column, this is based on the example you linked.

    Hope this helps,

    Sandy.

  • maximamaxima Posts: 2Questions: 1Answers: 0

    Thank you so much Sandy, this was really helpful :)

This discussion has been closed.