Search code examples
jqueryhtmlcsshandsontable

jquery-handsontable: passing a function to colWidth option


Background

In this handsontable tutorial, this line appears:

colWidths: [55, 80, 80, 80, 80, 80, 80], //can also be a number or a function

The ask...

Does anyone know (and have an example for) the use of the colWidths option when passing it a function?

  • Does this allow custom rendering of dynamic table resizing?
  • When is this function called?
  • What is the prototype?
  • Why is this functionality included?

Solution

  • It is a constructor option. If a function is possible, then:

    colWidths: function(){ return [55, 80, 80, 80, 80, 80, 80]; },