Search code examples
jqueryslickgrid

Is it possible to change width of a column in slickgrid programatically?


I tried grid.getColumns[index].width = <>. But, that doesn't resize the column.


Solution

  • You need to re-apply the column settings to the grid after you have modified the column width.

    $("#resize").click(function () {
        var cols = grid.getColumns();
        cols[0].width = 120;
        grid.setColumns(cols);
    });
    

    JSFiddle here