jQWidgets Forums

jQuery UI Widgets Forums Grid handlekeyboardnavigation problem

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 5 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • handlekeyboardnavigation problem #108330

    Serdar
    Participant

    hi , I’m using handlekeyboardnavigation but I have a problem
    I’m press key enter, but code works 2 times ( my english is not good )
    How can I terminate after the code runs?
    event.preventDefault() > not working..

      var $jqxgrid = $("#GridStoreCountingTableProducts");
       var count=0;
        $jqxgrid.jqxGrid({
            handlekeyboardnavigation: function (event) {
                if ($(event.target).closest($jqxgrid).length) { // check the closest is same as your grid element.
                    if (event.keyCode === 13) {
                    count++; ( count total = 2 )   
                    debugger; 
                    }
                }
            }
    
        });

    example image

    https://ibb.co/82G1t0j

    handlekeyboardnavigation problem #108365

    Hristo
    Participant

    Hello Serdar,

    Please, take a look at this example.
    I make these changes below in the provided example and it seems to work fine:

    handlekeyboardnavigation: function (event) {
        var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
        if (key == 13) {
            console.log(count);
            count++;
            return true;
        }
    }

    Could you clarify it?

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

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

You must be logged in to reply to this topic.