This is a migrated thread and some comments may be shown as answers.

reference to grid from vue

1 Answer 66 Views
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 14 Jan 2019, 03:03 PM

I need to be able to call grid hideColumn() method using the vue wrapper.

 

I've wired up the event from the grid like this:

<kendo-grid :before-edit="beforeEdit">

 

and then in my vue js I have:

 

methods: {

beforeEdit: function (e) {
        //how to hide column of the grid here?
      }

}

In the jQuery examples I could use 'this' to reference the grid but what is the method when using vue?

 

Thanks

Tony

1 Answer, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 15 Jan 2019, 10:23 AM
Hi Tony,

The Grid instance is available in the event handlers via the e.sender option:


methods: {
    beforeEdit: function (e) {
        var grid = e.sender;
 
    }
}


With that said, if you would like to make a column in the Grid conditionally editable I would recommend using the columns.editable option. Check out the example below that illustrates the approach:


Regards,
Viktor Tachev
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Asked by
Tony
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or