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

Setting global component options

4 Answers 230 Views
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 16 Jul 2018, 04:12 PM

I would like to be able to set kendo Vue component options globally, when needed.  For example, I want all grids in my app to have "selectable" set to "row".  Right now, we're having to bind it in every view with a grid:  :selectable="gridOptions.selectable"

Doing that method requires devs to remember to add it though.  With webforms, we were able to do that using AppThemes, so we're looking for something to that effect.  Can you guys recommend a better alternative?

4 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 18 Jul 2018, 09:55 AM
Hello Michael,

Each Grid (or another component in the Kendo UI Wrappers for Vue suite) instance has its own configuration. Multiple instances do not share a global configuration, therefore if you want to configure the selectable option of a Grid you need to set its own configuration attribute. It is the same in the Kendo UI for jQuery Grid - the selectable or any other option is configured per instance.

Regards,
Ivan Danchev
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
0
Michael
Top achievements
Rank 1
answered on 18 Jul 2018, 01:08 PM

Thanks for the response.  That's what we're doing already.  Assuming I didn't want to do it the standard way you mentioned, can you think of any way this can be accomplished?  Perhaps extend your components myself somehow, do some kind of Vue plugin, etc.  If you have any ideas, even if it doesn't involve any sample code, I would appreciate it.

0
Plamen
Telerik team
answered on 20 Jul 2018, 01:08 PM
Hi,

Thank you for getting back to us.

One possible way I could achieve similar behavior is by implementing a custom Vue component that gets Kendo Grid as mixin and could pass down its internal properties. I am attaching my test sample project. Please review it and let me know if you have further questions. 

Regards,
Plamen
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
0
Michael
Top achievements
Rank 1
answered on 25 Jul 2018, 07:01 PM
We usually try to avoid writing wrappers for kendo components, but that's an interesting solution.  Thanks for taking time to post it.
Asked by
Michael
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Michael
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or