import * as React from 'react'; import JqxMenu from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxmenu'; import JqxTree, { ITreeProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxtree'; class App extends React.PureComponent<{}, ITreeProps> { private myTree = React.createRef(); private myMenu = React.createRef(); private home = React.createRef(); private solutions = React.createRef(); constructor(props: {}) { super(props); this.myMenuOnItemClick = this.myMenuOnItemClick.bind(this); } public componentDidMount(): void { this.myTree.current!.selectItem(this.home.current); this.myTree.current!.expandItem(this.solutions.current); document.addEventListener('contextmenu', (event: any) => { event.preventDefault(); if ((event.target).classList.contains('jqx-tree-item')) { this.myTree.current!.selectItem(event.target.parentNode); const scrollTop = window.scrollY; const scrollLeft = window.scrollX; this.myMenu.current!.open(event.clientX + 5 + scrollLeft, event.clientY + 5 + scrollTop); } else { this.myMenu.current!.close(); } return false; }); } public render() { return (
  • Home
  • Solutions
    • Education
    • Financial services
    • Government
    • Manufacturing
    • Solutions
      • Consumer photo and video
      • Mobile
      • Rich Internet applications
      • Technical communication
      • Training and eLearning
      • Web conferencing
    • All industries and solutions
  • Products
    • PC products
    • Mobile products
    • All products
  • Support
    • Support home
    • Customer Service
    • Knowledge base
    • Books
    • Training and certification
    • Support programs
    • Forums
    • Documentation
    • Updates
  • Communities
    • Designers
    • Developers
    • Educators and students
    • Partners
    • By resource
      • Labs
      • TV
      • Forums
      • Exchange
      • Blogs
      • Experience Design
  • Company
    • About Us
    • Press
    • Investor Relations
    • Corporate Affairs
    • Careers
    • Showcase
    • Events
    • Contact Us
    • Become an affiliate
  • Add Item
  • Remove Item
); } private myMenuOnItemClick(event: any): void { const item = event.args.innerText; let selectedItem = null; switch (item) { case "Add Item": selectedItem = this.myTree.current!.getSelectedItem(); if (selectedItem != null) { this.myTree.current!.addTo({ label: 'Item' }, selectedItem.element); } break; case "Remove Item": selectedItem = this.myTree.current!.getSelectedItem(); if (selectedItem != null) { this.myTree.current!.removeItem(selectedItem.element); } break; } } } export default App;