jQWidgets
  • Documentation
  • License and Pricing
  • Services
  • Community
    • Forums
    • Blogs
    • Follow Us
    • Client Login
  • About
    • About Us
    • Contact Us
    • FAQ
  • Demo
  • Download

React UI Components

  • Javascript/jQuery
  • Angular
  • Vue
  • React
  • Custom Elements
  • ASP .NET MVC
  • Showcase Demos
  • Responsive Design
  • Theme Builder
Show Demo List

React UI Components

  • jqxGrid
  • jqxTabs
  • jqxTextArea
  • jqxWindow
  • jqxKnob
  • jqxResponsivePanel
  • jqxChart
  • jqxMenu
  • jqxInput
  • jqxDocking
  • jqxGauge
  • jqxNavBar
  • jqxPivotGrid
  • jqxTree
  • jqxPasswordInput
  • jqxNotification
  • jqxBarGauge
  • jqxSortable
  • jqxScheduler
  • jqxNavigationBar
  • jqxMaskedInput
  • jqxPopOver
  • jqxExpander
  • jqxLoader
  • jqxTreeGrid
  • jqxListMenu
  • jqxComplexInput
  • jqxTooltip
  • jqxRating
  • jqxDraw
  • jqxDataTable
  • jqxToolBar
  • jqxFormattedInput
  • jqxColorPicker
  • jqxRangeSelector
  • jqxDragDrop
  • jqxTreeMap
  • jqxComboBox
  • jqxNumberInput
  • jqxScrollView
  • jqxSlider
  • jqxPanel
  • jqxEditor
  • jqxDropDownList
  • jqxDateTimeInput
  • jqxProgressBar
  • jqxScrollBar
  • jqxValidator
  • jqxRibbon
  • jqxListBox
  • jqxCalendar
  • jqxFileUpload
  • jqxSplitter
  • jqxValidator
  • jqxLayout
  • jqxButtons
  • jqxKanban
  • jqxBulletChart
  • jqxDockingLayout

jqxMenu

  • Default Functionality
  • Context Menu
  • Vertical Menu
  • Minimized Menu
  • Open Direction
  • Columns
  • Images
  • JSON Menu
  • XML Menu
  • Load Menu from Array
  • Center Menu Items
  • Fluid Size
  • Keyboard Navigation
  • Right to Left Layout
Theme:
  • Demo
  • App.htm
  • App.js
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title id="Description">
        ReactJS Menu demo. This demo demonstrates how to use the jqxMenu widget as a Context Menu. In order to display the jqxMenu as Context Menu, you need to set the 'mode' property to 'popup'.
    </title>
    <link rel="stylesheet" href="../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqxmenu.js"></script>
    <script type="text/javascript" src="../scripts/demos.js"></script>
</head>
<body>
    <div class="example-description" style="margin-bottom:3em">
        ReactJS Menu demo. This demo demonstrates how to use the jqxMenu widget as a Context Menu. In order to display the jqxMenu as Context Menu, you need to set the 'mode' property to 'popup'.
    </div>
    <div id="app"></div>
    <script src="../build/menu_contextmenu.bundle.js"></script>
</body>
</html>

import React from 'react';import ReactDOM from 'react-dom';import JqxMenu from '../../../jqwidgets-react/react_jqxmenu.js';class App extends React.Component {
    componentDidMount() {
        document.getElementById('container').addEventListener('mousedown', (event) => {
            let rightClick = this.isRightClick(event) || $.jqx.mobile.isTouchDevice();
            if (rightClick) {
                let scrollTop = $(window).scrollTop();
                let scrollLeft = $(window).scrollLeft();
                this.refs.myMenu.open(parseInt(event.clientX) + 5 + scrollLeft, parseInt(event.clientY) + 5 + scrollTop);
                return false;
            }
        });
        document.addEventListener('contextmenu', e => e.preventDefault());
    }
    isRightClick(event) {
        let rightclick;
        if (!event) event = window.event;
        if (event.which) rightclick = (event.which == 3);
        else if (event.button) rightclick = (event.button == 2);
        return rightclick;
    }
    render() {
        let menuInnerHtml =
            `
                <ul>
                    <li><a href='#'>Home</a></li>
                    <li>About Us
                        <ul>
                            <li><a href='#'>History</a></li>
                            <li><a href='#'>Our Vision</a></li>
                            <li><a href='#'>The Team</a>
                                <ul>
                                    <li><a href='#'>Brigita</a></li>
                                    <li><a href='#'>John</a></li>
                                    <li><a href='#'>Michael</a></li>
                                    <li><a href='#'>Peter</a></li>
                                    <li><a href='#'>Sarah</a></li>
                                </ul>
                            </li>
                            <li><a href='#'>Clients</a></li>
                            <li><a href='#'>Testimonials</a></li>
                            <li><a href='#'>Press</a></li>
                            <li><a href='#'>FAQs</a></li>
                        </ul>
                    </li>
                    <li>Services
                        <ul>
                            <li><a href='#'>Product Development</a></li>
                            <li><a href='#'>Delivery</a></li>
                            <li><a href='#'>Shop Online</a></li>
                            <li><a href='#'>Support</a></li>
                            <li><a href='#'>Training &amp; Consulting</a></li>
                        </ul>
                    </li>
                    <li>Products
                        <ul>
                            <li><a href='#'>New</a>
                                <ul>
                                    <li><a href='#'>Corporate Use</a></li>
                                    <li><a href='#'>Private Use</a></li>
                                </ul>
                            </li>
                            <li><a href='#'>Used</a>
                                <ul>
                                    <li><a href='#'>Corporate Use</a></li>
                                    <li><a href='#'>Private Use</a></li>
                                </ul>
                            </li>
                            <li><a href='#'>Featured</a></li>
                            <li><a href='#'>Top Rated</a></li>
                            <li><a href='#'>Prices</a></li>
                        </ul>
                    </li>
                    <li><a href='#'>Contact Us</a>
                        <ul>
                            <li><a href='#'>Enquiry Form</a></li>
                            <li><a href='#'>Map &amp; Driving Directions</a></li>
                            <li><a href='#'>Your Feedback</a></li>
                        </ul>
                    </li>
                </ul>
            `;
        return (
            <div id='container' style={{ verticalAlign: 'middle', textAlign: 'center', background: '#eee', height: 400, width: 400 }}>
                <JqxMenu ref='myMenu'
                    width={120} height={140} template={menuInnerHtml}
                    autoOpenPopup={false} mode={'popup'}
                />
                <span style={{ fontSize: 14, position: 'relative', top: 180, fontFamily: 'Verdana' }}>
                    Right-Click here to Open the Menu
                </span>
            </div>
        )
    }
}

ReactDOM.render(<App />, document.getElementById('app'));

jQWidgets
  • Facebook
  • Youtube
  • Google +
  • Demo
  • Download
  • Documentation
  • License and Pricing
  • Services
  • Forums
  • About
  • Terms of Use
  • Privacy Policy
  • Contact Us

jQWidgets © 2011-2019. All Rights Reserved.