Search code examples
datagriddojo

how can I make a column unsortable when using the dojo toolkit's grid?


I've got a grid (dojox.grid v1.2) that I don't want to be sortable. How can I disable that?


Solution

  • Found it:

    http://dojotoolkit.org/forum/dojox-dojox/dojox-grid-support/disable-sorting-specific-column-0

    To save linking:

    In your onload, or postrender add code like this:

    dojo.byId('myGridId').canSort = function(col){ if(Math.abs(col) == 3) { return false; } else { return true; } };

    (Note, the columns seem to be indexed from 1 in this setting.)