jQuery UI Widgets Forums Grid Vertical Selection

This topic contains 2 replies, has 2 voices, and was last updated by  Basm 10 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Vertical Selection #31711

    Basm
    Participant

    Hi,

    i have a grid with only one editable column, is there’s any way i can restrict selection with TAB key to this column?

    so user clicking TAB will go to next row but same column

    Vertical Selection #31762

    Dimitar
    Participant

    Hello Basm,

    Here is an example, based in the demo Custom Keyboard Navigation:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.10.2.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/jqxmenu.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.edit.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.columnsresize.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>
    <script type="text/javascript" src="../../scripts/gettheme.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    var theme = "";
    var url = '../sampledata/nasdaq_vs_sp500.txt';
    var source =
    {
    datatype: "csv",
    datafields: [
    { name: 'Date', type: 'date' },
    { name: 'S&P 500', type: 'float' },
    { name: 'NASDAQ', type: 'float' }
    ],
    url: url
    };
    var dataAdapter = new $.jqx.dataAdapter(source);
    $("#jqxgrid").jqxGrid(
    {
    width: 670,
    source: dataAdapter,
    theme: theme,
    columnsresize: true,
    editable: true,
    ready: function () {
    $("#jqxgrid").jqxGrid('focus');
    },
    editmode: 'selectedcell',
    selectionmode: 'singlecell',
    handlekeyboardnavigation: function (event) {
    var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
    if (key == 9) {
    var selectedCell = $('#jqxgrid').jqxGrid('getselectedcell');
    $('#jqxgrid').jqxGrid('selectcell', selectedCell.rowindex + 1, selectedCell.datafield);
    return true;
    };
    },
    columns: [
    { text: 'Date', datafield: 'Date', cellsformat: 'D', width: 250 },
    { text: 'S&P 500', datafield: 'S&P 500', width: 200, cellsformat: 'f' },
    { text: 'NASDAQ', datafield: 'NASDAQ', width: 200, cellsformat: 'f' }
    ]
    });
    });
    </script>
    </head>
    <body class='default'>
    <div id='jqxWidget'>
    <div id="jqxgrid">
    </div>
    </div>
    </body>
    </html>

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    Vertical Selection #31820

    Basm
    Participant

    working fine, thank you!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.