ColVis and Scroller collides

ColVis and Scroller collides

davidkonraddavidkonrad Posts: 13Questions: 4Answers: 0
edited August 2012 in General
xx

Replies

  • davidkonraddavidkonrad Posts: 13Questions: 4Answers: 0
    edited August 2012
    I use Scroller and ColVis in the same resulttable. The columns is defined as below.

    Then, when I hide / show a column either by the default popup or through code, Scroller creates an extra set of column headers, as row 0. Also, it generates an error, "Cannot read property 'sWidth' of undefined", at line 3137, v1.9.1, line 3138, v1.9.2, Both scroller and Colvis is the latest. But it should not generate an extra set of headers, and should know the dimensions of each column.

    aoColumns: [
    {bSortable: false,
    sWidth : "100px"
    },
    {bVisible: true,
    sWidth: "100px"
    },
    {bVisible: false,
    sWidth: "100px"
    },
    {bVisible: false,
    sWidth: "100px"
    }
    ]
  • davidkonraddavidkonrad Posts: 13Questions: 4Answers: 0
    http://debug.datatables.net/ezupoc
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    > Scroller creates an extra set of column headers, as row 0

    This is simply the way that scrolling works in DataTables, regardless of scrolling. The headers are used to align the columns - which are the applied widths. If you want the columns to be exactly 100px, then you will need to use `table-layout: fixed` in your CSS, since the browser is currently correcting the values given for some reason (content alignment, width not being 400px, different box model etc).

    The Javascript error sounds wrong though.

    Can you link us to your test case please?

    Thanks,
    Allan
This discussion has been closed.