Hide an element conditionally by its value

2019-09-21 02:16发布

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.

2条回答
淡お忘
2楼-- · 2019-09-21 02:43

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");
查看更多
Summer. ? 凉城
3楼-- · 2019-09-21 02:49

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?

查看更多
登录 后发表回答