Skip to content

Commit

Permalink
Add custom kb nav sample for treegrid. (#258)
Browse files Browse the repository at this point in the history
* Add custom kb nav sample for treegrid.

* Re-use grid keydown handler and make the blazor one more agnostic.
  • Loading branch information
MayaKirova authored Dec 6, 2023
1 parent 0a3afb4 commit 725bb0f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion code-gen-library/WebGridCustomKBNav/Blazor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ igRegisterScript("WebGridCustomKBNav", (evtArgs) => {
const target = args.target;
const evt = args.event;
const type = args.targetType;
var grid = document.getElementsByTagName("igc-grid")[0];
var grid = args.target.grid;

if (type === 'dataCell' && target.editMode && evt.key.toLowerCase() === 'tab') {
// Value validation for number column.
Expand Down
58 changes: 58 additions & 0 deletions samples/grids/tree-grid/keyboard-custom-navigation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"export": true,
"skipAlterDataCasing": true,
"descriptions": {
"content": {
"type": "WebTreeGrid",
"name": "treeGrid",
"id": "treeGrid",
"dataRef": "EmployeesNestedData",
"childDataKey": "Employees",
"autoGenerate": false,
"rowSelection": "Multiple",
"moving": true,
"allowFiltering": true,
"gridKeydownRef": "WebGridCustomKBNav",
"paginationComponents": [
{
"type": "WebPaginator",
"perPage": 15
}
],
"columns": [
{
"type": "WebColumn",
"field": "Name",
"header": "Name",
"dataType": "String",
"sortable": true,
"editable": true,
"resizable": true
},
{
"type": "WebColumn",
"field": "HireDate",
"header": "Hire Date",
"dataType": "Date",
"sortable": true,
"editable": true,
"resizable": true
},
{
"type": "WebColumn",
"field": "Age",
"header": "Age",
"dataType": "Number",
"sortable": true,
"editable": true,
"resizable": true
}
]
}
},
"modules": [
"withDescriptions",
"layouts/PropertyEditorPanelModule",
"grids/WebTreeGridModule"
]
}

0 comments on commit 725bb0f

Please sign in to comment.