bosskmk / pluto_grid

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
637 stars 291 forks source link

[Help] How to select a row by code. #946

Closed ricardo-guimaraes-tcepr closed 7 months ago

ricardo-guimaraes-tcepr commented 9 months ago

Hi, I need some help to know how to select a row by line of code. I have tried this without success:

  1. Using currentSelectingRows stateManager.currentSelectingRows.clear(); stateManager.currentSelectingRows.add(rendererContext.row);

  2. Using toggleSelectingRow stateManager.toggleSelectingRow(currentRowkr, notify: true);

  3. Using setCurrentSelectingRowsByRange stateManager.setCurrentSelectingRowsByRange(currentRowkr, currentRowkr);

My PlutoGrid definition: PlutoGrid( mode: PlutoGridMode.selectWithOneTap, columns: columns, rows: rowsDados, onSelected: (event) { currentRowkr = event.rowIdx ?? -1; }, onLoaded: (PlutoGridOnLoadedEvent event) { stateManager = event.stateManager; stateManager .setConfiguration( stateManager.configuration.copyWith(localeText: const PlutoGridLocaleText.brazilianPortuguese(), columnSize: PlutoGridColumnSizeConfig( autoSizeMode: PlutoAutoSizeMode.none))); stateManager.setSelectingMode(PlutoGridSelectingMode.row);
}, )

Acacio2000 commented 9 months ago

select event.row!.setChecked(true); stateManager.notifyListeners();

unselect event.row!.setChecked(false); stateManager.notifyListeners();

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 7 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.