简体   繁体   English

如何在Syncfusion Angular Grid中扩展像元?

[英]How to expand a cell in a Syncfusion Angular Grid?

I'm using Syncfusion GirdComponent in my project and instead of using command column, I want to have a column with just a toggle button for each row and when I click on the button the cell expands horizontally and other buttons appear - and I want just that cell expands not the whole column- and with the second click the cell goes back to it's first state. 我在我的项目中使用Syncfusion GirdComponent,而不是使用命令列,我希望有一列,每行只有一个切换按钮,当我单击该按钮时,单元格会水平展开并出现其他按钮-我只想该单元格不会展开整个列-再次单击该单元格将返回其第一状态。 I tried adding another css class to the td element (parent of the toggle button) and in that class I give a higher width but it doesn't change. 我尝试向td元素(切换按钮的父级)添加另一个css类,在该类中,我给出了更大的宽度,但它没有变化。 is there any way I can do this? 有什么办法可以做到吗?

You can use the detailTemplate feature of Grid component to show toggle button on each row which will expand the row horizontally. 您可以使用Grid组件的detailTemplate功能在每行上显示切换按钮,这将水平扩展该行。

Demo 演示

And By default grid does not expand in the cell level but cells can be expanded according the requirements. 并且默认情况下,网格不会在单元格级别扩展,但是可以根据要求扩展单元格。 Please refer to the below tree grid demo, 请参考下面的树状网格演示,

Demo: https://ej2.syncfusion.com/angular/demos/#/material/treegrid/columntemplate 演示: https : //ej2.syncfusion.com/angular/demos/#/material/treegrid/columntemplate

please get back to us with more details if you need any further assistance. 如果您需要任何进一步的帮助,请与我们联系以提供更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM