Responsive with a hidden column

Responsive with a hidden column

Karl53Karl53 Posts: 72Questions: 29Answers: 0

DataTables 1.10.6, Responsive April '15 release, BootStrap 3.3.4

I just upgraded to latest versions as noted above and I have an issue with Responsive that I have not had before.

When the table layout includes a hidden column, the green plus icon is always present instead of just being present when a display column is hidden.

Here is a rather simple example that demonstrates this problem:

Responsive Example

And one other small item:

responsive.js at about line 824:

// Attach a listener to the document which listens for DataTables initialisation
// events so we can automatically initialise
$(document).on( 'init.dt.dtr', function (e, settings, json) {
    if ( e.namespace !== 'dt' ) {
        return;
    }

    if ( $(settings.nTable).hasClass( 'responsive' ) ||
         $(settings.nTable).hasClass( 'dt-responsive' ) ||
         settings.oInit.responsive ||
         DataTable.defaults.responsive
    ) {
        console.log( e.namespace );

        var init = settings.oInit.responsive;

        if ( init !== false ) {
            new Responsive( settings, $.isPlainObject( init ) ? init : {}  );
        }
    }
} );

Should this line be executed?:

console.log( e.namespace );

Thanks,
Karl

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Hi Karl,

    console.log( e.namespace );

    That is an error :-(. I left a debug line in the code by mistake. I'll be doing a release soon to remove that (it already has been int he nightly). I was holding off on an immediate release to see if any other issues were reported.

    When the table layout includes a hidden column, the green plus icon is always present instead of just being present when a display column is hidden.

    The green plus icon is shown whenever there is a column that is hidden that can be displayed in the child row. That appears to be the case in your example. If you don't want the column to ever be visible use the columns.className option to add a never class to the column.

    Regards,
    Allan

This discussion has been closed.