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

jqxDataTable

  • Default Functionality
  • Data Binding
    • Local Data
    • Remote Data
    • XML Data
    • JSON Data
    • CSV Data
    • TSV Data
  • Rows
    • Row Template
    • Row Details
    • Row Selection & Hover
  • Columns
    • Columns Hierarchy
    • Column Formatting
    • Column Alignment
    • Column Resize
    • Column Reorder
    • Show or Hide Column
    • Pinned(Frozen) Column
    • Column Template
    • Header Template
  • Editing
    • Inline Row
    • Dialog
    • Lock Row
    • Cell Edit
    • Custom Editors
    • Validation
  • Sorting
    • Sorting
    • Server Sorting
    • Sorting API
  • Filtering
    • Filtering
    • Search Field
    • Advanced Filtering
    • Server Filtering
    • Filtering API
  • Paging
    • Paging
    • Server Paging
    • Paging API
  • Master Details
    • Nested Tables
    • Separate Tables
  • Aggregates
    • Aggregates
    • Aggregates Template
  • Grouping
    • Grouping
    • Grouping & Server Paging
  • Data Export
  • Data Printing
  • Localization
  • Conditional Formatting
  • Fluid Size
  • Keyboard Navigation
  • Right to Left Layout
Theme:
  • Demo
  • App.htm
  • App.js
Keyboard Navigation in React DataTable
Loading...
  • Left Arrow key is pressed - Navigates to the Previous Page. If Row Details is enabled, Collapses the Row.
  • Right Arrow key is pressed - Navigates to the Next Page. If Row Details is enabled, Expands the Row.
  • Up Arrow key is pressed - Selects the row above.
  • Down Arrow key is pressed - Selects the row below.
  • Page Up/Down is pressed - Navigate Up or Down with one page.
  • Home/End is pressed - Navigate to the first or last row on the current page.
  • Enter key is pressed - Saves the Edited Row.
  • Esc key is pressed - Closes all Editors and Cancels the changes.
  • F2 key is pressed - Enters edit mode for the currently selected row.
  • Shift+Arrow key extends the selection.
  • Shift extends the selection when an end user clicks on a row.
  • Ctrl key is pressed - extends the selection when an end user clicks on a row.
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title id='Description'>
        Keyboard Navigation in React DataTable
    </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/jqxdata.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../jqwidgets/jqxdatatable.js"></script>
    <script type="text/javascript" src="../scripts/demos.js"></script>
</head>
<body>
    <div class="example-description" style="margin-bottom:3em">
        Keyboard Navigation in React DataTable
    </div>
    <div id="app"></div>
    <script src="../build/datatable_keyboardnavigation.bundle.js"></script>
</body>
</html>

import React from 'react';import ReactDOM from 'react-dom';import JqxDataTable from '../../../jqwidgets-react/react_jqxdatatable.js';class App extends React.Component {
    componentDidMount() {
        this.refs.myDataTable.on('bindingComplete', () => {
            this.refs.myDataTable.focus();
            this.refs.myDataTable.selectRow(0);
        });
    }
    render() {
        let source =
            {
                dataType: 'xml',
                dataFields: [
                    { name: 'ShippedDate', map: 'm\\:properties>d\\:ShippedDate', type: 'date' },
                    { name: 'Freight', map: 'm\\:properties>d\\:Freight', type: 'float' },
                    { name: 'ShipName', map: 'm\\:properties>d\\:ShipName', type: 'string' },
                    { name: 'ShipAddress', map: 'm\\:properties>d\\:ShipAddress', type: 'string' },
                    { name: 'ShipCity', map: 'm\\:properties>d\\:ShipCity', type: 'string' },
                    { name: 'ShipCountry', map: 'm\\:properties>d\\:ShipCountry', type: 'string' }
                ],
                root: 'entry',
                record: 'content',
                id: 'm\\:properties>d\\:OrderID',
                url: '../sampledata/orders.xml'
            };

        let dataAdapter = new $.jqx.dataAdapter(source);

        let columns =
            [
                { text: 'Ship Name', dataField: 'ShipName', width: 350, align: 'left', cellsAlign: 'left' },
                { text: 'Freight', dataField: 'Freight', width: 180, align: 'right', cellsFormat: 'F2', cellsAlign: 'right' },
                { text: 'Ship Address', dataField: 'ShipAddress', align: 'left', width: 350, cellsAlign: 'left' },
                { text: 'Ship City', dataField: 'ShipCity', width: 100, align: 'left', cellsAlign: 'left' },
                { text: 'Ship Country', dataField: 'ShipCountry', align: 'left', cellsAlign: 'left' }
            ];

        return (
            <div>
                <JqxDataTable ref='myDataTable'
                    width={850} source={dataAdapter}
                    pageable={true} editable={true} columns={columns}
                />
                <div style={{ fontFamily: 'Verdana', fontSize: 12, width: 670 }}>
                    <ul>
                        <li><b>Left Arrow</b> key is pressed - Navigates to the Previous Page. If Row Details is enabled, Collapses the Row.</li>
                        <li><b>Right Arrow</b> key is pressed - Navigates to the Next Page. If Row Details is enabled, Expands the Row.</li>
                        <li><b>Up Arrow</b> key is pressed - Selects the row above.</li>
                        <li><b>Down Arrow</b> key is pressed - Selects the row below.</li>
                        <li><b>Page Up/Down</b> is pressed - Navigate Up or Down with one page.</li>
                        <li><b>Home/End</b> is pressed - Navigate to the first or last row on the current page.</li>
                        <li><b>Enter</b> key is pressed - Saves the Edited Row.</li>
                        <li><b>Esc</b> key is pressed - Closes all Editors and Cancels the changes.</li>
                        <li><b>F2</b> key is pressed -  Enters edit mode for the currently selected row.</li>
                        <li><b>Shift+Arrow</b> key extends the selection.</li>
                        <li><b>Shift</b> extends the selection when an end user clicks on a row.</li>
                        <li><b>Ctrl</b> key is pressed - extends the selection when an end user clicks on a row. </li>
                    </ul>
                </div>
            </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.