Row underneath--similar to the hidden row details example

Row underneath--similar to the hidden row details example

bugmenotbugmenot Posts: 3Questions: 0Answers: 0
edited January 2014 in General
I'm looking at this example:
http://datatables.net/release-datatables/examples/api/row_details.html

My data looks something like this:
http://fiddle.jshell.net/Lw9Up/3/show/

The last column will usually be empty. I want all of the extra rows to always be visible without requiring a click.

I think what I essentially need is mRender that runs on the row instead of the column. I'm running 1.10 if that helps any.

Replies

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    > I want all of the extra rows to always be visible without requiring a click.

    Just run fnOpen in the draw callback ( fnDrawCallback ) rather than in a click event handler then.

    Allan
  • bugmenotbugmenot Posts: 3Questions: 0Answers: 0
    Scope in JS is not my forte.

    http://live.datatables.net/aRaT/1/
  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    I don't see fnDrawCallback in there.
  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Agreed - fnDrawCallback is what I suggested. Try for example: http://live.datatables.net/aRaT/2/edit . You can use fnGetData to get the data for each row if that is what you want.

    Allan
  • bugmenotbugmenot Posts: 3Questions: 0Answers: 0
    The reason I used fnRowCallback instead of fnDrawCallback is because of what the docs say:
    [quote]This function is called on every 'draw' event[/quote]
    Since I need it to run on every row and not once on the table I thought that would be a better fit.
    But using the $.each function is easy enough. The fnGetData function is handy; $(this).find('blah') also would work.

    Thanks so much for your help Allan.
This discussion has been closed.