Combine Row Details and Exclude Column Functionality, Row Details
Combine Row Details and Exclude Column Functionality, Row Details
joejames800
Posts: 6Questions: 0Answers: 0
My goal is to combine the functionality of both:
http://www.datatables.net/examples/api/row_details.html and
http://www.datatables.net/release-datatables/extras/ColVis/exclude_columns.html
Another words... toggle on/off row details, combined with the show hide list of columns in one table.
1. Easy there any easy way to combine the two?
2. How do you change the row details to have different text for each row? I found this but when I make a change it applies it to all row details:
[code] /* Formating function for row details */
function fnFormatDetails ( oTable, nTr )
{
var aData = oTable.fnGetData( nTr );
var sOut = '';
sOut += 'Rendering engine:'+aData[1]+' '+aData[4]+'';
sOut += 'Link to source:Could provide a link here';
sOut += 'Extra info:And any further details here (images etc)';
sOut += '';
return sOut;
}
[/code]
http://www.datatables.net/examples/api/row_details.html and
http://www.datatables.net/release-datatables/extras/ColVis/exclude_columns.html
Another words... toggle on/off row details, combined with the show hide list of columns in one table.
1. Easy there any easy way to combine the two?
2. How do you change the row details to have different text for each row? I found this but when I make a change it applies it to all row details:
[code] /* Formating function for row details */
function fnFormatDetails ( oTable, nTr )
{
var aData = oTable.fnGetData( nTr );
var sOut = '';
sOut += 'Rendering engine:'+aData[1]+' '+aData[4]+'';
sOut += 'Link to source:Could provide a link here';
sOut += 'Extra info:And any further details here (images etc)';
sOut += '';
return sOut;
}
[/code]
This discussion has been closed.
Replies
I've put together a working example of the two examples you linked to, combined together, here: http://live.datatables.net/amuduf/4/edit#source .
Allan
http://live.datatables.net/amuduf/4/edit#source
but the ColVis doesn't seem to work? the option to show/ hide list of columns like in this example is not there: http://www.datatables.net/release-datatables/extras/ColVis/exclude_columns.html
Allan
Are you getting any Javascript errors on the Firebug console?
Allan
Here is a screenshot of what I see (note firebug displays no errors):
http://oi43.tinypic.com/6oga3d.jpg
Also how do you change the row details to have different text for each row?