Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    grid: disabling user cell selection while retaining cell selection programmatically

    SmartClient Version: v10.0p_2015-03-24/Enterprise Deployment (built 2015-03-24)

    Hello, I'm trying to disable cell-level selection in a Grid:
    canSelectCell: function (rowNum, colNum) {return false;}

    and then, because the docs says about canSelectCell:
    <If ListGrid.canSelectCells is set to true, this method will be called for each cell the user attempts to select. If it returns false, the cell will not be selected. >

    I was hoping I could select cell programmatically:
    grid.getCellSelection().selectCell(1,1)

    but the cell doesn't get selected.

    Actually I've verified that canSelectCell isn't called after the selectCell method call.
    So, is it intended behavior or a bug?
    Isn't it possible to achieve this behavior?

    #2
    What we're seeing with this test case is that your canSelectCell() implementation *is* in fact being called, and preventing your selectCell() call from doing anything, as expected.

    Note that we consider it a non-goal to try to support programmatic selection which disallowing the user to select the same cell. This is because the user can generally de-select any cell by just starting a new selection.

    If you want to maintain some kind of special, non-editable selection while allow the user to select other cells, what we'd recommend is just to mimic selection styling for the specially selected cells, rather than try to treat them as part of the user-editable selection.

    Comment

    Working...
    X