Is it possible to make, let’s say, first 4 columns of fixed width, and rest of the columns of dynamic width depending on text entered into cell?
Or maybe it’s possible to set max width for specific columns? Because when I don’t provide colWidths all columns are auto sized, but I need to fix width for first columns.
Hi @dmitriy.vovney
you can just pass the array of 4 values if the columns are adjacent
Here’s a demo: http://jsfiddle.net/soykhzm4/
and if not (but you know the index of those cols) you can do it like this:
http://jsfiddle.net/7u1kxjLe/16/
Ok, second example is more interesting. But the problem is you calculating column width depending on data which is placed in specific column at first row. So if I change data at second row, columns won’t change it’s size. What do I need to do? Call autoColumnSize.calculateColumnsWidth
for each row?
Hi @dmitriy.vovney
you could share the index as a variable using afterChange
hook. This hook in it’s first parameter returns a row index where a change has been made.