FixedColumns destroy / blank out original column cells

FixedColumns destroy / blank out original column cells

WeaponX86WeaponX86 Posts: 40Questions: 0Answers: 0
edited December 2013 in Plug-ins
We are experiencing fixed column doubling when you resize the page.

Here is what it looks like on page load:
http://i.imgur.com/QIL3CdT.jpg

Here is what happens if you resize the browser window:
http://i.imgur.com/OPyFlhb.jpg

And one customer sent this where even at full screen there is some overlap:
http://i.imgur.com/RG0Wt5d.jpg

Can an option be added to destroy the original column or overwrite it's contents with a spacer?

Replies

  • WeaponX86WeaponX86 Posts: 40Questions: 0Answers: 0
    As a followup to my initial question, would it be possible for FixedColumn to skip drawing if the table below already fits the screen width?
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Which version of FixedColumns are you using? If not 3.0.0 then I would suggest updating. Can you please link to a test case so I can debug it?

    Allan
  • WeaponX86WeaponX86 Posts: 40Questions: 0Answers: 0
    edited January 2014
    I'm running DT 1.9.4 with FixedColumns 2.5.0. Just tried updating to 3.0.0 and now I'm getting a script error...

    [quote]ReferenceError: FixedColumns is not defined
    new FixedColumns( oTable, oFixedOptions);[/quote]

    [code]
    var oTable = jq('#work_orders').dataTable(oDTSettings);
    //console.log(oTable.fnSettings());

    var oFixedOptions = {
    "fnRowCallback": '',
    "fnDrawCallback": fnPluginDrawCallback,
    "iLeftColumns": 0,
    "sHeightMatch": "none"
    }

    // If the last column is icons, apply the fixed column plugin
    if(window.aoColumnDefs[window.aoColumnDefs.length-1].mData == "icons"){
    oFixedOptions.iRightColumns = 1;
    }

    // Don't render on IE8 or below
    if (!(jq.browser.msie && jq.browser.version <= '8')){
    new FixedColumns( oTable, oFixedOptions);
    }
    [/code]

    EDIT: Here is a link to jsFiddle running DT 1.9.4 and FixedColumn 3.0.0 with the same error.
    http://jsfiddle.net/weaponx86/MEWQZ/
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    With 3.0.0 you need to use `$.fn.dataTable.FixedColums` : http://jsfiddle.net/MEWQZ/4/ .

    All of the plug-ins have been updated to not pollute the global namespace with their latest releases: http://datatables.net/extras/fixedcolumns/

    Allan
  • WeaponX86WeaponX86 Posts: 40Questions: 0Answers: 0
    Got it. So to revisit my original question, when you initially load the page and then resize it, the fixed column is doubled, including duplicating any unique ids which is causing other problems.

    Screenshots: http://imgur.com/TLlBDxJ,pOwRXD5#0

    Could the original cells be replaced with empty placeholders or maybe just fix the column width below?
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    The sScrollXInner option is mucking stuff up. I'd very much recommend not using it (it is going to be undocumented in v1.10). Just remove it and let the browser assign the column widths. If you want content to be on a single row, use `td { white-space: nowrap; }` (which is the normal reason for using sScrollXInner ).

    Allan
  • WeaponX86WeaponX86 Posts: 40Questions: 0Answers: 0
    edited January 2014
    I actually don't use sScrollXInner on the live code, that test page was just to show the FixedColumn error. I actually only use sScrollX: 100% because without it, DataTAbles spills off the edge of the screen and creates double scrollbars.

    http://imgur.com/zgqHfTN

    Edit: Here is a link to a pure html version of the page:
    https://alpha.propertypreswizard.com/test_scripts/beta/right_column.html
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Fantastic - thanks for the link. I don't have an immediate fix to suggest, other than trying DataTables 1.10 dev? I'm about to dash out the door, but I'll take a look at this when I can.

    Allan
This discussion has been closed.