smasala / ColResize

DataTables extension to make columns resizable
MIT License
22 stars 12 forks source link

stateSave: true only saves header widths, but not column width. #16

Closed funkindy closed 5 years ago

funkindy commented 5 years ago

Google Chrome 71

Issue appears with stateSave: true (both DT and colResize) and with colresize`s scrollY: true:

$('#content-table').DataTable( {
    colResize: {
        scrollY: 500,
        minColumnWidth: 50,
        stateSave: true
    },
    autoWidth: false,
    scrollX: false,
    stateSave: true
} );

This causes inconsistency after page reloads: only the header width got saved, but not column width. Disabling scrollY under colResize fix this behaviour but the table is no longer scrollable.

funkindy commented 5 years ago

Somehow jQuery handles $th.css("width", thWidth); differently with and without scrollY. With scrollY set it only applies width on th element, not on the appropriate tds. Without scrollY width is set on entire column.

smasala commented 5 years ago

@funkindy is this still the case?

funkindy commented 5 years ago

@smasala sorry i've switched to another table plugin because i didnt succeed with painless resizing columns in DataTables.

smasala commented 5 years ago

Ok thanks, then I'll close this.