详细模板事件 [英] Detail Template Events

查看:73
本文介绍了详细模板事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户与详细信息模板进行交互时,Kendo是否支持网格事件.具体来说,当用户打开单独的一行时,我希望为详细信息模板加载数据.

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.

我最好的解决方案是在网格上放置一个单击事件处理程序,并验证目标是否对应于打开/关闭详细信息模板的按钮.但是,如果kendo表示发生更改,这似乎很复杂且容易出错.

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.

推荐答案

您可以将详细信息模板包装在自定义组件中,并使用Angular生命周期挂钩来获取您的内容.应该是这样的:

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>

这篇关于详细模板事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆