Server side, global search in hidden rows data

Server side, global search in hidden rows data

razvan_379razvan_379 Posts: 4Questions: 1Answers: 0

Hello!

I am using a table with hidden rows like in this example: http://www.datatables.net/examples/server_side/row_details.html

I want to know if there is a way of searching in the data that is hidden in row details?
I hope i was clear enough. Thank you!

Razvan

This question has an accepted answers - jump to answer

Answers

  • DaimianDaimian Posts: 62Questions: 1Answers: 15

    Using data() would get you all data including the hidden rows. Additionally you can use the Datatables API to find the data your looking for.

  • razvan_379razvan_379 Posts: 4Questions: 1Answers: 0

    Can you show me am example? I did'n find anything clearly showing how to do this.

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    Where is the data for your child rows stored? @Daimian is simply suggesting that you get the data and loop over it doing a simple search for the required data.

    Allan

  • razvan_379razvan_379 Posts: 4Questions: 1Answers: 0
    edited July 2014

    The data is stored in the database. I insert it in the hidden row as a table like this:

                 function format ( d ) {
                      var table = '<table><tr><td>'+d.field_1+'</td><td>'+d.field_2+'</td>...</tr></table>';
                   }
    

    is there a way of searching in the fields from db that are hidden in the table as in the example from my post?

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Answer ✓

    Searching as in using the global DataTables filter? If so, then the data would need to be included in hidden columns as the child rows have no effect on the table filtering.

    Allan

  • razvan_379razvan_379 Posts: 4Questions: 1Answers: 0

    Ok! I understand. Thank you very much for your time. Sorry for my bad english. :)
    When i make my firs money from my app i'll donate. I find datatable very useful tool.

This discussion has been closed.