jQWidgets Forums

jQuery UI Widgets Forums Grid Deleting row content

Tagged: 

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Deleting row content #23920

    When we have a editable grid, if we press delete on a selected row (not even in edit mode), all the values os this row disappear, even if we defined this row not to be editable.

    Is there a way to prevent that from happening?

    Deleting row content #23947

    Peter Stoev
    Keymaster

    Hi,

    You can override the keyboard navigation and handle the ‘DEL’ key by using the following approach:

        $("#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 == 46) {
    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' }
    ]
    });

    Best Regards,
    Peter Stoev

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

    Deleting row content #24040

    Thanks!

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

You must be logged in to reply to this topic.