Why does not search work inside the collapsed data?

Why does not search work inside the collapsed data?

onkar4inonkar4in Posts: 4Questions: 2Answers: 0
edited October 7 in Free community support

I have created a table with reference to link below

https://datatables.net/examples/api/row_details.html

when I expand the first row, "Name: Airi Satou" , the extension number is 5407

If I search for 5407 in the search box, I get "No Matches found".

Can you please let me know if there is any solution for this? Doesn't search work in the collapsed columns?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,488Questions: 1Answers: 10,467 Site admin

    The data you are searching on needs to be in a column. In the example you link to, you would just have a hidden column with the extension number in it.

    Otherwise, DataTables doesn't know anything about the extension numbers. It is only used in a custom renderer in that example.

    Allan

  • onkar4inonkar4in Posts: 4Questions: 2Answers: 0

    Thanks Allan for quick response. Is there anyway by which we can search extension number also? the data which is not in the column?

  • kthorngrenkthorngren Posts: 21,315Questions: 26Answers: 4,948
    Answer ✓

    Add a column, for the extension number, to the table and use columns.visible to hide the column. This will allow Datatables to search for the extension.

    Kevin

  • onkar4inonkar4in Posts: 4Questions: 2Answers: 0

    thanks kthorngren

  • rf1234rf1234 Posts: 2,988Questions: 87Answers: 421

    If you use the responsive extension to create child rows you don't have the problem by the way. Columns hidden by the responsive extension are searchable.

    https://datatables.net/extensions/responsive/examples/initialisation/option.html

Sign In or Register to comment.