Using the filter with fnOpen'd data

Using the filter with fnOpen'd data

kaseykrehbielkaseykrehbiel Posts: 18Questions: 2Answers: 0
edited July 2011 in General
The Search (filter) function works great with tabular data that's already there, but it won't search on data that is pulled in using fnOpen (more info here: http://datatables.net/release-datatables/examples/api/row_details.html)

Would it make sense to put that data in a hidden column and use that column to filter the results, or is there a better way to do it than that?

EDIT: I just tried to put the data in a hidden column, but the problem is I can't pull the data out of the hidden column to display it in the detail area because if you set something bVisible = false, it doesn't show up in the markup!

Thanks for your help!

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    You are correct - the way to include it in the search is to have it in a hidden column. But rather than trying tog et the data using DOM / jQuery methods, you need to use the DataTables API (since the column has been hidden - i.e. removed from the DOM). For this the API method fnGetData ( http://datatables.net/ref#fnGetData ) is the one you want.

    Allan
  • kaseykrehbielkaseykrehbiel Posts: 18Questions: 2Answers: 0
    edited July 2011
    Thanks Allan! That's what I needed!

    But I have another problem. I'm trying to display information from a text field in the "details" area, and any carriage returns entered into the text are ignored. Any ideas? Thanks again for your help!!!

    EDIT: Nevermind I figured it out. Thanks again!!!
This discussion has been closed.