datatables.plugins icon indicating copy to clipboard operation
datatables.plugins copied to clipboard

ColResize: strange visual effect in chrome

Open rockshandy opened this issue 11 years ago • 6 comments

First I'd like to say awesome plugin for the newer version of DataTables! I've been experimenting with column resizing with scrollX set which seems to work fine in Firefox. When I resize columns in chrome, some of the column content (and headers) are a little glitchy.

Sometimes half the cell (dived horizontally) will move or header text will disappear. It does correct itself once I move my mouse over the strange looking area, updating to what would expect. This doesn't seem to happen if disable horizontal scrolling.

Here are my initial options to DataTables:

{
  deferRender: true,
  scrollX: true,
  dom: 'lrtpRJ',
  colResize: {
    fixedLayout: true,
    minWidth: 40
  }
}

I also have some basic css for overflow:

table.dataTable td, table.dataTable th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

Have you seen this happen before?

rockshandy avatar Jan 21 '15 19:01 rockshandy

Thanks,

it seems that the current version of Chrome has this glitch, previous haven't. Sadly I tried the Canary version and the glitch is still there :( At the moment I don't have a clue how to fix that. Example

maca88 avatar Jan 22 '15 21:01 maca88

Ah that is a shame (but at least I'm not crazy?). I was experimenting with some things, and it seemed like after a resize I could at least call DataTable().draw(false) to clean up the table in chrome. Without editing ColResize itself, I wasn't sure when the perfect time to do that would be.

rockshandy avatar Jan 23 '15 16:01 rockshandy

Interesting... I will probably call the draw function when Chrome is used... in the meantime you can do something like this: Example

maca88 avatar Jan 23 '15 17:01 maca88

Ah that does seem like a good way of doing things for now, thanks. I haven't dived to deep into the code but I see why this would work.

rockshandy avatar Jan 23 '15 17:01 rockshandy

I found a fix for this issue using a css trick. Example

maca88 avatar Jan 30 '15 23:01 maca88

Oh good find! I will update my code and remove that previous bit of code.

rockshandy avatar Feb 05 '15 19:02 rockshandy