Como criar colunas dinâmicas para o Handsontable?

Eu estou trabalhando com Handsontable para criar uma grade web que pode copiar / colar entre web e excel, eu tentei com o código abaixo e funciona bem:

  var first = true;
  var exampleGrid = $("#exampleGrid");
  exampleGrid.handsontable({
      rowHeaders: true,
      colHeaders: true,
      stretchH: 'all',
      minSpareCols: 0,
      minSpareRows: 0,
      height: 600,
      columns: [
      { data: "Id", title: "ID", type: "text" }, //'text' is default, you don't actually have to declare it
      { data: "Name", title: "Name", type: "text" },
      { data: "DisplayColor",
      title: "Display Color",
      type: 'autocomplete',
      source: ["yellow", "red", "orange", "green", "blue", "gray", "black", "white"]
      },
      { data: "Description", title: "Description", type: 'text' },
      { data: "IsDeleted", title: "Is Deleted", type: 'checkbox' }
      ],
      colWidths: [400, 100, 60, 100, 50, 40, 40, 60], //can also be a number or a function
      contextMenu: false,
  });

Agora preciso criar grade web com colunas dinâmicas, tentei substituir a lista de colunas com a função abaixo, mas não funciona:

    columns:
        function () {
            var cols = [];
            for (var i = 0; i < 1; i++) {
                var col = new Object();

                col.data = "Name";
                col.title = "Name" + i.toString();
                col.type = "text";
                cols[i] = col;
            }
            return cols;
        },

É possível criar colunas dinâmicas na grade de Handsontable? e como fazer isso?

Eu sou um iniciante em JavaScript, então, por favor, me diga se houve algum erro, obrigado!

questionAnswers(1)

yourAnswerToTheQuestion