patentvur.blogg.se

Jquery datatable adjust columns on resize
Jquery datatable adjust columns on resize




jquery datatable adjust columns on resize

The columns are thin and they dont take all the space of the modal. $('#example').dataTable( ) Mentions Emphram Stavanger Steve Chambers Allan Jardine Stephen jps Rui Martins Chintan Panchal Community user2314493 mezzie Emmanuel Robert Ssebaggala Keith.$('#ASBresultsModal').on('shown.bs. The problem is that, when opening the modal, the columns layout is not right.

jquery datatable adjust columns on resize

What you can do to stop this behaviour in DataTables is set the autoWidth parameter to false.

jquery datatable adjust columns on resize

However this plug-in was not compatible with the latest version of jQuery DataTables. responsive.recalc().columns.adjust() solved it. Then, whenever the sidebar was collapsed or reopened, I was calling the columns.adjust().responsive.recalc() Reordering it. So what was happening was, the table was being created on the first load. I read that I should call ('datatable').DataTable().columns.adjust() ('datatable').DataTable().responsive.recalc() to re-adjust columns width, but nothing happens. Past version of jQuery DataTables had column reordering plug-in ColReorderWithResize that also provided the ability to resize columns by clicking and dragging the point between two columns. Answers related to datatables column resize datatable column width reload datatable datatable on page change datatables column freeze datatable giving default width to colums reinitialize datatable on button click columndefs in datatable not working while setting width jquery datatables modify rows datatable table header not. I had tabs as well a sidebar in my application. The columns are thin and they don't take all the space of the modal.

jquery datatable adjust columns on resize

This repository is based on a no longer supported version of the ColReorderWithResize plugin. Main features - Resize columns by mouse drag or touch - Resizable can be set for each column. I hope it's good enough to be useful for somebody else as well. The reason it does this is to stop the table and the columns (the column widths are also set) jumping around in width when you change pagination. The problem is that, when opening the modal, the columns layout is not right. ColReorderResize adds the ability for the end user to click and drag column headers to reorder and resize a table as they see fit, to DataTables. Since we are using datatables at work and we just needed a resizable column functionality, I've implemented a plugin called 'colResize'. What is happening is that DataTables is setting the CSS width of the table when it is initialised to a calculated value - that value is in pixels, hence why it won't resize with your dragging.






Jquery datatable adjust columns on resize