Missing event in external mode: editCancel
- 主要言語
- TypeScript
- スター
- 1.6k
- フォーク
- 867
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
ng2-smart-action-edit-cancel button does not trigger any event, which makes things tricky to know the edit state of the grid in external mode.
- we can know if a user pressed the edit button by using the `edit` Output
- we can know if a user pressed the edit confirm button by using the `editConfirm` Output
- but we CAN'T know is a user pressed the edit cancel button directly
---
A workaround is to listen to `rowHover` event and check for `isInEditing: false` in pair with an instance var storing the index of the last edited row.
But this is tricky and not ideal because this event is triggered a lot (on mouse hover).
```html
```
```ts
onRowHover(row) {
if (row.isInEditing) {
this.currentlyEditedRowIndex = row.index
}
if (!row.isInEditing && row.index === this.currentlyEditedRowIndex) {
console.log(`Edition has been cancelled for row ${row.index}`)
this.currentlyEditedRowIndex = null
}
}
onEdit(row) {
console.log(`Edition has been triggered for row ${row.index}`)
// Set current row in edit mode
row.isInEditing = true;
}
```
---
Would that be possible to see added `editCancel` event?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。