Combine Row Details and Exclude Column Functionality, Row Details

Combine Row Details and Exclude Column Functionality, Row Details

joejames800joejames800 Posts: 6Questions: 0Answers: 0
edited November 2011 in DataTables 1.8
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]

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    There was a limitation in ColVis in that it wasn't taking into account the changing of the number of visible columns for the details rows. I've just committed a change to ColVis which does now take this into account, which you can download as the nightly: http://datatables.net/download .

    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
  • joejames800joejames800 Posts: 6Questions: 0Answers: 0
    Thank you Allan for the quick response! I looked at the working example:
    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
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Did you click the "render" button: http://live.datatables.net/amuduf/4/edit#preview ? At the top left of the table is the ColVis button. Its slightly different from the example because I've not included the CSS file for ColVis :-)

    Allan
  • joejames800joejames800 Posts: 6Questions: 0Answers: 0
    Thank you again for your continued help. Yes, I clicked the render button at the top but I don't see the ColVis button anywhere on the page. I tried with Firefox and IE and I also tried adding in the ColVis CSS file for fun but nothing so far.
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    I've just added the ColVis stylesheet and it is showing up for me exactly the same as the demo: http://live.datatables.net/amuduf/5/edit (Firefox and Safari - can't test IE atm...)

    Are you getting any Javascript errors on the Firebug console?

    Allan
  • joejames800joejames800 Posts: 6Questions: 0Answers: 0
    Hmm... I checked it in a few browsers and I don't see the option to show/hide columns like in: http://www.datatables.net/release-datatables/extras/ColVis/exclude_columns.html

    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?
This discussion has been closed.