fnOpen, hidden rows and form elements?

fnOpen, hidden rows and form elements?

devsysdevsys Posts: 2Questions: 0Answers: 0
edited December 2010 in General
Hello and first off, just wanted to say DataTables rocks!

Secondly, I am attempting to retrieve the values of html input elements contained within a hidden row using the following code:

[code]var sData = $('input', oTable.fnGetNodes()).serialize();[/code]

If I put the html element (say a checkbox) in standard datacolumn, this works and I can get the value.

If I place the same checkbox inside fnOpen's 2nd parameter, I cannot get the value. Is there any way around this? What might I be doing wrong?

Thanks!

Replies

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    fnGetNodes will give you an array of the TR elements in the table, not including the 'details' row that fnOpen adds - it only give's the data rows. There are two options to get around this - you could add a class to the details cell using the third parameter of fnOpen and then use a query to get that node. Or you could use the DataTables internal cache (oTable.fnSettings().aoOpenRows[i].nTr - you would need a counter for 'i' here) to get all hidden rows regardless of paging.

    Allan
This discussion has been closed.