Search code examples
slickgrid

Slickgrid onHeaderClick detect column number


I've tried to detect column number when clicking on it, but it has no result. Tried to use getCellFromEvent, but it works for cells only, not headers, other methods which can do the same for grid - not found. Please help.

Thanks


Solution

  • You need to use the arguments:

    grid.onHeaderClick.subscribe(function(e, args) {
        var columnID = args.column.id;
        console.log(columnID);
    });