UNPKG

jqwidgets-framework

Version:

jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.

94 lines (88 loc) 5.39 kB
<!DOCTYPE html> <html lang="en"> <head> <title id='Description'>Keyboard Navigation in jqxDataTable</title> <meta name="description" content="JavaScript dataTable Keyboard Navigation" /> <link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" /> <script type="text/javascript" src="../../../scripts/jquery-1.12.4.min.js"></script> <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 id='content'> <script type="text/javascript"> $(document).ready(function () { var url = "../../sampledata/orders.xml"; // prepare the data var 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: url }; var dataAdapter = new $.jqx.dataAdapter(source); // create jqxDataTable. $("#dataTable").jqxDataTable( { width: getWidth("dataTable"), source: dataAdapter, editable: true, pageable: true, ready: function() { // focus jqxDataTable. $("#dataTable").jqxDataTable('focus'); $("#dataTable").jqxDataTable('selectRow', 0); }, 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' } ] }); }); </script> <div id='jqxWidget' v> <div id='dataTable'> </div> <div style="font-family: Verdana; font-size: 12px; width: 670px;"> <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> </div> <div style="position: absolute; bottom: 5px; right: 5px;"> <a href="https://www.jqwidgets.com/" alt="https://www.jqwidgets.com/"><img alt="https://www.jqwidgets.com/" title="https://www.jqwidgets.com/" src="https://www.jqwidgets.com/wp-content/design/i/logo-jqwidgets.png"/></a> </div> </body> </html>