import * as React from 'react'; import JqxTree, { ITreeProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxtree'; class App extends React.PureComponent<{}, ITreeProps> { private myTree = React.createRef(); constructor(props: {}) { super(props); this.state = { source: [ { expanded: true, icon: "https://www.jqwidgets.com/react/images/mailIcon.png", items: [ { icon: "https://www.jqwidgets.com/react/images/calendarIcon.png", label: "Calendar" }, { icon: "https://www.jqwidgets.com/react/images/contactsIcon.png", label: "Contacts", selected: true } ], label: "Mail" }, { expanded: true, icon: "https://www.jqwidgets.com/react/images/folder.png", items: [ { icon: "https://www.jqwidgets.com/react/images/folder.png", label: "Admin" }, { icon: "https://www.jqwidgets.com/react/images/folder.png", label: "Corporate" }, { icon: "https://www.jqwidgets.com/react/images/folder.png", label: "Finance" }, { icon: "https://www.jqwidgets.com/react/images/folder.png", label: "Other" }, ], label: "Inbox" }, { icon: "https://www.jqwidgets.com/react/images/recycle.png", label: "Deleted Items" }, { icon: "https://www.jqwidgets.com/react/images/notesIcon.png", label: "Notes" }, { iconsize: 14, icon: "https://www.jqwidgets.com/react/images/settings.png", label: "Settings" }, { icon: "https://www.jqwidgets.com/react/images/favorites.png", label: "Favorites" } ] } } public componentDidMount(): void { this.myTree.current!.focus(); } public render() { return (
  • Tab - Like other widgets, the jqxTree widget receives focus by tabbing into it. Once focus is received, users will be able to use the keyboard to change the selection. A second tab will take the user out of the widget.
  • Shift+Tab - reverses the direction of the tab order. Once in the widget, a Shift+Tab will take the user to the previous focusable element in the tab order.
  • Up and Down arrow keys - move between visible items.
  • Left Arrow key - on an expanded item, collapses the item.
  • Left Arrow key - on a collapsed or end item moves focus to the item's parent item.
  • Right Arrow key - on a collapsed item expands the item.
  • Right Arrow key - on an expanded item, moves to the first child item, or does nothing on an end item.
  • Home key - moves to the top item in the tree view.
  • End key - moves to the last item in the tree view.
); } } export default App;