Search code examples
coldfusioncoldfusion-9extjs3coldfusion-10cfgrid

How to programmatically select rows in CFGRID with multiselectrow on CF9.01+?


Why's there ColdFusion.grid.getSelectedRows but no setSelectedRows()?

Doc: Adobe ColdFusion 10 * ColdFusion.grid.getSelectedRows

Then how shall one select rows programmatically???

Sigh... gotta be careful with <cfgrid> before I hit the wall.


Solution

  • I am not sure about 9.0.1, but in CF10 try selectRange or selectRecords.

    var grid = ColdFusion.Grid.getGridObject('myGrid');
    var model = grid.getSelectionModel();
    
    model.selectRange(4, 6, false);
    // ... or
    var records = [grid.store.getAt(10)];
    model.selectRecords(records , true);