Child rows (show extra / detailed information)
The DataTables API has a number of methods available for attaching child rows to a parent row in the DataTable. This can be used to show additional information about a row, useful for cases where you wish to convey more information about a row than there is space for in the host table.
The example below makes use of the
row().childDT
methods to firstly check if a row is already displayed, and if so hide it (row().child.hide()DT
), otherwise show it (row().child.show()DT
). The content of the child row is, in this example, defined by the formatDetails()
function, but you would replace that with whatever you wanted to show the content required, possibly including, for example, an Ajax call to the server to obtain the extra information to show.Name | Position | Office | Salary | |
---|---|---|---|---|
Zorita Serrano | Software Engineer | San Francisco | $115,000 | |
Zenaida Frank | Software Engineer | New York | $125,250 | |
Yuri Berry | Chief Marketing Officer (CMO) | New York | $675,000 | |
Vivian Harrell | Financial Controller | San Francisco | $452,500 | |
Unity Butler | Marketing Designer | San Francisco | $85,675 | |
Timothy Mooney | Office Manager | London | $136,200 | |
Tiger Nixon | System Architect | Edinburgh | $320,800 | |
Thor Walton | Developer | New York | $98,540 | |
Tatyana Fitzpatrick | Regional Director | London | $385,750 | |
Suki Burks | Developer | London | $114,500 |
Basic initialisation
- Zero configuration
- Feature enable / disable
- Default ordering (sorting)
- Multi-column ordering
- Multiple tables
- Hidden columns
- Complex headers (rowspan and colspan)
- DOM positioning
- Flexible table width
- State saving
- Alternative pagination
- Scroll - vertical
- Scroll - horizontal
- Scroll - horizontal and vertical
- Scroll - vertical with jQuery UI ThemeRoller
- Language - Comma decimal place
- Language options
Advanced initialisation
- DOM / jQuery events
- DataTables events
- Column rendering
- Page length options
- Multiple table control elements
- Complex headers (rowspan / colspan)
- HTML5 data-* attributes
- Language file
- Setting defaults
- Row created callback
- Row grouping
- Footer callback
- Custom toolbar elements
- Order direction sequence control
API
- Add rows
- Individual column searching (text inputs)
- Individual column searching (select inputs)
- Highlighting rows and columns
- Child rows (show extra / detailed information)
- Row selection (multiple rows)
- Row selection and deletion (single row)
- Form inputs
- Index column
- Show / hide columns dynamically
- Using API in callbacks
- Scrolling and jQuery UI tabs
- Search API (regular expressions)
Comments
Post a Comment