Add footer option to sDom
Add footer option to sDom
trudrung
Posts: 5Questions: 0Answers: 0
I'm using DataTables with ColumnFilterWidgets. I would like to add a ColumnFilterWidget to each column footer (TFOOT TR TH, TH, ...) in the table rather than having ColumnFilterWidgets group them in a separate DIV. It would look similar to this example: http://www.datatables.net/release-datatables/examples/api/multi_filter_select.html (one SELECT per column). One thought was to modify both DataTables and ColumnFilterWidgets:
DataTables modification:
Modify _fnAddOptionsHtml() to allow a new sDom option that would allow adding an object to the TFOOT object (oSettings.nTFoot). This would typically be a TR element that would be returned by ColumnFilterWidgets from ColumnFilterWidgets.fnInit().
[code]
else if ( cOption == '.' ) // '.' represents the option allowing TFOOT modifications
{
nInsertNode = the TFOOT object
}
[/code]
ColumnFilterWidgets modifications:
Modify ColumnFilterWidgets() to format a TR element with TDs for all columns. ColumnFilterWidgets.fnInit() would return the TR element which DataTables would append to nInsertNode as it does now.
I'm not sure how feasible or sound my approach is.
DataTables modification:
Modify _fnAddOptionsHtml() to allow a new sDom option that would allow adding an object to the TFOOT object (oSettings.nTFoot). This would typically be a TR element that would be returned by ColumnFilterWidgets from ColumnFilterWidgets.fnInit().
[code]
else if ( cOption == '.' ) // '.' represents the option allowing TFOOT modifications
{
nInsertNode = the TFOOT object
}
[/code]
ColumnFilterWidgets modifications:
Modify ColumnFilterWidgets() to format a TR element with TDs for all columns. ColumnFilterWidgets.fnInit() would return the TR element which DataTables would append to nInsertNode as it does now.
I'm not sure how feasible or sound my approach is.
This discussion has been closed.
Replies
Allan