-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend Grid API to allow custom keyboard navigation #4646
Conversation
…into ddincheva/customKBNav
…into ddincheva/customKBNav
…into ddincheva/customKBNav
…into ddincheva/customKBNav
…into ddincheva/customKBNav
…into ddincheva/customKBNav
…into ddincheva/customKBNav
After initial testing, everything looks good. I have only two comments below:
|
…into ddincheva/customKBNav
…gniteui-angular into ddincheva/customKBNav
…gniteui-angular into ddincheva/customKBNav
CHANGELOG.md
Outdated
- `onFocusChange` event is deprecated. | ||
- `onGridKeydown` is exposed. The event will emit | ||
`IGridKeydownEventArgs { targetType: GridKeydownTargetType; target: Object; event: Event; cancel: boolean; }` | ||
- `navigateTo(rowIndex: number, visibleColumnIndex: number, callback({targetType, target: Object }))` - this method allows you to navigate to a randon position in the grid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `navigateTo(rowIndex: number, visibleColumnIndex: number, callback({targetType, target: Object }))` - this method allows you to navigate to a randon position in the grid; | |
- `navigateTo(rowIndex: number, visibleColumnIndex: number, callback({targetType, target: Object }))` - this method allows you to navigate to a position in the grid based on provided `rowindex` and `visibleColumnIndex`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update navigteTo description
…gniteui-angular into ddincheva/customKBNav
return nextRow ? this.verticalScrollContainer.igxForOf.indexOf(nextRow) : currentRowIndex; | ||
} | ||
|
||
private isValidPosition(rowIndex, colIndex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't have return type
} | ||
} | ||
|
||
public getPreviousCell(currRowIndex: number, curVisibleColIndex: number, callback: (IgxColumnComponent) => boolean = null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public API. Doesn't have description and code snippet.
Also there is no return type. You should introduce a new interface.
} | ||
} | ||
|
||
public getNextCell(currRowIndex: number, curVisibleColIndex: number, callback: (IgxColumnComponent) => boolean = null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public API. Doesn't have description and code snippet.
Also there is no return type. You should introduce a new interface.
@@ -4884,6 +4905,136 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements | |||
directive.scrollTo(goal); | |||
} | |||
|
|||
public navigateTo(rowIndex: number, visibleColIndex = -1, cb: Function = null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public API. Doesn't have description and code snippet.
return {rowIndex: currRowIndex, visibleColumnIndex: nextCellIndex}; | ||
} else { | ||
if (colIndexes.length === 0 || this.getNextDataRowIndex(currRowIndex) === currRowIndex) { | ||
return {rowIndex: this.getNextDataRowIndex(currRowIndex), visibleColumnIndex: curVisibleColIndex}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please introduce a new type/interface. We don't want anonymous objects. See "Anonymous objects is a no-no."
return {rowIndex: currRowIndex, visibleColumnIndex: prevCellIndex}; | ||
} else { | ||
if (colIndexes.length === 0 || this.getPrevDataRowIndex(currRowIndex) === currRowIndex) { | ||
return {rowIndex: this.getPrevDataRowIndex(currRowIndex), visibleColumnIndex: curVisibleColIndex}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please introduce a new type/interface.
Closes #4054
Additional information (check all that apply):
Checklist:
feature/README.MD
updates for the feature docsREADME.MD
CHANGELOG.MD
updates for newly added functionalityng update
migrations for the breaking changes