From bd804fdcb8d1a8d5897a48ffcd475ce3ca46d6b6 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 7 May 2013 17:56:07 +0100 Subject: [PATCH] New: child row API methods for showing / hiding child rows - Showing and hiding details about a row in a child row is very useful and proven to be a popular part of DataTables. This commit provides that ability in the new API and extends it. It also fully modularises the child rows aspects, so it could be removed from the core without effecting any other aspects (it may be moved into a seperate file in future). - This will effectively replace fnOpen, fnClose and fnIsOpen - Added methods: - row( selector, opts ).child() - row( selector, opts ).child( str, class ) - row( selector, opts ).child( str, class ).show() - row( selector, opts ).child( str, class ).hide() - row( selector, opts ).child.show() - row( selector, opts ).child.hide() - row( selector, opts ).child.isShown() - Note that unlike the old API you need to specify the data first, and then use the show() method to show the child row. This allows the details rows to be configured before they are actually shown. - Additionally multiple child rows can be attached to a parent (pass `str` (from above) as an array to use this feature. API plug-ins could use this ability to show fully nested tables. - Not just a string can be passed in now, but also a TR node which will actually be used (rather than put into a nested row), any other type of node (which will be inserted into a wrapper row/cell) or a jQuery object. --- examples/api/row_details.html | 507 ++++----------------------------- media/src/api/api.columns.js | 2 + media/src/api/api.core.js | 9 +- media/src/api/api.row.js | 145 ++++++++++ media/src/core/core.columns.js | 9 +- media/src/core/core.draw.js | 10 - media/src/core/core.support.js | 19 +- 7 files changed, 222 insertions(+), 479 deletions(-) diff --git a/examples/api/row_details.html b/examples/api/row_details.html index f7f73dc0..65867d69 100644 --- a/examples/api/row_details.html +++ b/examples/api/row_details.html @@ -8,67 +8,63 @@