jQuery UI Widgets Forums Grid 'rowclick' event argument

This topic contains 3 replies, has 2 voices, and was last updated by  Dimitar 9 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • 'rowclick' event argument #62138

    Yuri Jin
    Participant

    Hi,
    I have a Jqxgrid of ‘singlerow’ selection mode and ‘rowclick’ event method.
    And I need to get clicked column name like datafield of ‘cellselect’.

    I found ‘_clickedcolumn’ in rowclick event argument.
    What’s the exact meaning of that?
    And What’s the diffrence between ‘event.owner._clickedcolumn’ and ‘event.args.owner._clickedcolumn’?

    There is my ‘rowclick’ event method below.

    $(ID_DATA_GRID).on(‘rowclick’, function(event) {
    console.log(event);

    var col = event.owner._clickedcolumn;
    console.log(col);

    });

    When I try to test that, there is what I need in ‘event.owner._clickedcolumn’ (using ‘Console’ window of google chrome).
    But variable ‘col’ have previous value of clicked column name.
    For example, when I click ‘a’ column, then variable ‘col’ is ‘undefined’.(but ‘event.owner._clickedcolumn’ is ‘a’ in chrome console window)
    and then I click ‘b’ column, then ‘col’ is ‘a’.(but ‘event.owner._clickedcolumn’ is ‘b’ in chrome console window)

    What’s the solution of that ? And can I get the clicked column name using ‘rowclick’ event?

    'rowclick' event argument #62303

    Dimitar
    Participant

    Hello Yuri Jin,

    We suggest you bind to the cellclick event instead. You can access the clicked column in the event’s handler with event.args.datafield.

    Best Regards,
    Dimitar

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

    'rowclick' event argument #62340

    Yuri Jin
    Participant

    Hi Dimitar, Thanks to reply.

    When I use ‘singlerow’ selection mode, can I bind ‘cellclick’ event?
    Actually I want to use ‘singlerow’ selection mode because of selection area.
    (when I select a row, its background color will be changed automatically in ‘singlerow’ selection mode)

    'rowclick' event argument #62350

    Dimitar
    Participant

    Hi Yuri Jin,

    In selectionmode: "singlerow" you can bind to both cellclick and rowclick.

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.