jQuery UI Widgets Forums Vue(New) How to access grid from updaterow function

This topic contains 1 reply, has 2 voices, and was last updated by  Martin 1 month, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • How to access grid from updaterow function #107431

    jerrade
    Participant

    My grid is defined like this:
    <JqxGrid ref="myGrid" :source="dataAdapter"></JqxGrid>

    I want to check in the updaterow function if the data has changed before I submit it to the server. I want to get the original data like this:
    $('#jqxgrid').jqxGrid('getrowdata', rowid);

    But I can’t do that because I don’t know the id of the grid element (because it was assigned automatically).
    I can’t access the grid like this:
    this.$refs.myGrid
    because “this” references the dataadapter, not the Vue component. Is there another way to access the grid, or is there a different way I should handle the row updates? Thanks.


    Martin
    Participant

    Hello jerrade,

    You could use the updaterow callback as an arrow function so the scope remains the same as that of the Vue component.
    Please, take a look at the following Example.

    Best Regards,
    Martin

    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.