jQuery UI Widgets Forums Grid How can I find out from which object the event was called?

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  admin 2 months, 3 weeks ago.

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

  • Serdar
    Participant

    I want the event to work only on mouse click, how can this happen?

    I use grid, this event is for the general grid. It is triggered when I select a row with the mouse.

     $(document).on("rowselect", ".grid", function (e) {
        e.preventDefault();
      
    }); 

    but this rowselect is triggered again on an input event

    
    $('#GROUP_MDL_TEX_GROUP_CODE').off('keyup');
    $(document).on("keyup", "#GROUP_MDL_TEX_GROUP_CODE", function (e) {
        e.stopImmediatePropagation();
    
        $("#GridProduct").jqxGrid('selectrow', 0);
        $('#GridProduct').jqxGrid('focus');
    });
    

    $("#GridProduct").jqxGrid('selectrow', 0);

    This line in the input event triggers the grid rowselect event, I want to prevent this.
    I used e.stopImmediatePropagation(); but still “rowselect” is triggered.

    thank you

        $(document).on("rowselect", ".grid", function (e) {
        e.preventDefault();
        if(e.type == "keyup")
         return false; 

    When I look with e.type, it shows the triggering of the current event e.type=”rowselect” but I need the type of the previous event, ie e.type=”keyup” but I could not find the previous type

    keyup is an example. Many events like this affect the “rowselect” event.


    Serdar
    Participant

    and my last question
    why does rowunselect run automatically after the rowselect event when I select the row with the mouse? how can I prevent this?
    I added e.stopImmediatePropagation(); but it didn’t work
    sample code for all my questions
    thanks

    jsfiddle


    admin
    Keymaster

    Hi Serdar,

    You cannot prevent the event to be raised when you do like this. However, as you know your logic, you can put a boolean flag which you can set to true when you select with a method call and add that boolean flag in the event handler.

    Best regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.