I want to change the default options for some components, e.g all the window component in my app should to 400px width and 400px max-height. The way I use now is to create a component wrapper the kendo-window, but I must repeatedly define lots of kendo props in my component.
I also try to use Vue mixin like this
Any methods to be simpler?
5 Answers, 1 is accepted
For setting width and max-height to the Window I would suggest you to use CSS. Below is an example where the 'k-window' class is used for setting width:
I am afraid that properties like 'title' could not be configured for multiple widgets at once. For example it is not possible to set the title of two Window widgets at the same time.
Make your own window component with the kendo ui window component in it. Add custom props to your component for everything in the component you want to set when you use it. But inside your component set all the kendo props to the defaults you want.
Then in your app's components always use your own custom component instead of the kendo ui window component directly.
Below is an article that will be helpful for creating custom widget:
I'm not suggesting making a kendo ui jquery widget. I am suggesting making a simple Vue component that wraps the Window component. Something like this:
Assuming the person is using single file components.. Either way the idea is the same. The wrapped component can then be used in another component like:
I apologize for the inaccurate information in the last reply.
Props could be assigned dynamically with v-bind. So, the respective code for the Kendo Window for Vue will looks as follows:
If you'd like to set global default options per component, I would suggest creating a custom Vue component with mixin Kendo Window and configure the default prop values. You could refer to the following forum thread which discusses similar scenario for the Grid widget - the implementation is analogical to the Window:
I hope this is what you have been looking for. Let me know if you have further questions.