Detail Template Events

我怕爱的太早我们不能终老 提交于 2020-01-06 17:10:02

问题


Does Kendo support grid events when users interact with Detail Templates. Specifically, I am looking to load the data for the detail template when a user opens an individual row.

The best solution I have is to place a click event handler on the grid and verify the target corresponds to the button that opens/closes the detail template. However, this seems complicated and error-prone if the kendo representation changes.


回答1:


You can wrap the detail template in your custom component and use the Angular lifecycle hooks to fetch your content. It should be something like:

<template kendoDetailTemplate let-dataItem>
  <data-fetch-component *ngIf="dataItem.Category">
    <header>{{dataItem.Category?.CategoryName}}</header>
    <article>{{dataItem.Category?.Description}}</article>
  </data-fetch-component>
</template>


来源:https://stackoverflow.com/questions/40686653/detail-template-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!