Hide an element conditionally by its value

不想你离开。 提交于 2019-12-13 23:35:23

问题


I have a kendo grid containing following columns.

1.Name

2.Age

3.Type{values:public,private}

I need to hide a column in specific row. In my problem, i want to hide age cell if Type value is private.


回答1:


using if else format

 columns.Template(@<text></text>)
                        .ClientTemplate("#if (field == value) {#"
                        + "<a></a>"
                        + "#}else {#"
                        +"<input name='chkSubscribed' class='subscribedClass'type='type': '' #/>"
                        + "#} #").Width(130).Title("title");



回答2:


You can't hide the cell but you can hide the age depending of the other columns. See https://docs.telerik.com/aspnet-mvc/helpers/grid/faq#how-to-apply-conditional-logic-to-client-column-templates on how to apply conditional logic to columns?



来源:https://stackoverflow.com/questions/55949597/hide-an-element-conditionally-by-its-value

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