# toastui grid getselectedRows 구현

- 주소: https://duotone.co.kr/entry/toastui-grid-getselectedRows-%EA%B5%AC%ED%98%84
- 글쓴이: 서기㏇
- 카테고리: 개발·프로그래밍
- 작성일: 2021-12-23
- 수정일: 2022-11-11
- 태그: Get, getselectedrows, Grid, rows, Selected, Toast, toast ui, UI, 선택된, 셀의

```

function getSelectedRows(){

  var a = grid.getSelectionRange();
  var c = [];

  if(!a){
    i = grid.getFocusedCell();
    d = {'rowKey':i.rowKey};
    c.push(d);

  }else{
    var s = a.start[0];
      var e = a.end[0];

      for(i=s; i0) return c;
 else return null;
}
```

toastui grid는 정말 좋은데. 
현재 드래그한 셀들의 행번호를 반환해주는 함수는 따로 없어서 만들었다. 
rowKey를 반환해 주는 함수이다.
