_adjustColspan() Bug with rowGroup + endRender for multiple column calcs.

_adjustColspan() Bug with rowGroup + endRender for multiple column calcs.

cristianprcristianpr Posts: 3Questions: 0Answers: 0

Hello,
good morning, I just had this problem and I want to know if it is a real bug or if I can omit the _adjustColspan() so as not to force the tds created in endRender to have colspans.
I control the visibility of the "endRender tds" by myself with ".on("column-visibility.dt","
Test: http://live.datatables.net/samumepo/3/
Thank you all ;)

Replies

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    See this thread with a similar question.

    Kevin

  • cristianprcristianpr Posts: 3Questions: 0Answers: 0

    Thanks, i fixed id with:

    $(document).on( "preInit.dt.dtrg", function (e, settings) {
        $(settings.nTable).dataTable().on("column-visibility.dt.dtrg", function(e, s, column, state){
            // I hide some custmo filter here
            $($("#"+s.nTable.id + " #filterOptions").children()[column])[state ? "show" : "hide"]();
            $($($("#"+s.nTable.id + " #filterOptions").children()[column]).children()[0]).val("");
            $($($("#"+s.nTable.id + " #filterOptions").children()[column]).children()[0]).change();
            // I hide my custom footers/headers here
            var dataTable = $(settings.nTable).dataTable().api();
            if(dataTable){
                dataTable.columns().every( function (colIndex) {
                    if(this.column(colIndex).visible()){
                        if($("#"+s.nTable.id + " #th-filter-" + colIndex).length) $("#"+s.nTable.id + " #th-filter-" + colIndex).show();
                        if($("#"+s.nTable.id + " .td-footer-" + colIndex).length) $("#"+s.nTable.id + " .td-footer-" + colIndex).show();
                        if($("#"+s.nTable.id + " .th-footer-" + colIndex).length) $("#"+s.nTable.id + " .th-footer-" + colIndex).show();
                    } else {
                        if($("#"+s.nTable.id + " #th-filter-" + colIndex).length) $("#"+s.nTable.id + " #th-filter-" + colIndex).hide();
                        if($("#"+s.nTable.id + " .td-footer-" + colIndex).length) $("#"+s.nTable.id + " .td-footer-" + colIndex).hide();
                        if($("#"+s.nTable.id + " .th-footer-" + colIndex).length) $("#"+s.nTable.id + " .th-footer-" + colIndex).hide();
                    }
                });
            }
            $(s.nTable).dataTable().api().draw(true);
        });
    } );
    
  • cristianprcristianpr Posts: 3Questions: 0Answers: 0

    I lied to you, I thought so but no haha ​​he keeps adding colspans with the draw when he feels like it. :s

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    Not sure if that means you are still having problems. If you are please provide a test case showing what you are doing so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

Sign In or Register to comment.