open details after dynamicly add rows

open details after dynamicly add rows

insideinside Posts: 1Questions: 0Answers: 0
edited July 2009 in General
How can ik open de details from a added row.

I have try this:
http://datatables.net/forums/comments.php?DiscussionID=181&page=1#Item_0

the example to expand a row is here:
http://datatables.net/1.5-beta/examples/api/row_details.html

the example to add a row is here:
http://datatables.net/1.5-beta/examples/api/add_row.html

how can i combine this 2 functions? anyone a idea?

Thanks

Replies

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin
    HI inside,

    Basically you need to add the event handlers for fnOpen() and fnClose() to your new row as it is created. There are lots of ways of doing this. Here are two off the top of my head:

    1. Use $().live() to add a single generic handler for all rows
    2. Take the returned index from fnAddRow() and use fnGetNodes() to get the added node and stick an event handler on that.

    Hope this helps,
    Allan
This discussion has been closed.