We have a number of Vue components we've built and are looking for a way render those components in a row's detail cell of a kendo grid.
Is there any guidance on how we might load a component and specify props and slots while accessing the event data?
4 Answers, 1 is accepted
For rendering detail template in the Grid component that contains other Vue components, the "detail-template" property should be set to point to a function that returns a Vue Template. For your convenience, following are links for the "detail-template" and the "Vue template":
If any further assistance is needed on this matter, please do not hesitate to contact us again.
If I understand the examples you posted, "templateArgs" is part of the component's data object. And presumably any data key could be set using that approach.
How would I go about setting props or even working with slots? Is that supported?
I was able to set props and slots using the detailint event:
But this breaks down when working with the "template" prop for kendo-grid-column since there's not a way to insert the component's element into the corresponding td... at least not to my knowledge.
I was able to return the outerHTML of a mounted component. It does render the component's template properly but it also seems to lose the event bindings which largely defeats the purpose.
Any suggestions on working with Vue components and Kendo's template props?
Using the detailInit event could not be used for this particular requirement and the only option is the suggested approach in the help topic from my previous post:
The important part is the following, where the event arguments are passed to the template in the templateArgs object:
Note that within the template you will have access to the dataItem by using "templateArgs.model".
Hope this helps.