在KendoGrid中更改单元格样式 [英] change cell styling in KendoGrid

查看:226
本文介绍了在KendoGrid中更改单元格样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是发现KendoGrid,并试图在更改另一个单元格值之后更改单个列(单元格)的样式.例如,我有一个带有shipname和shipcity列的网格.假设我有一条业务规则说:

Just discovered the KendoGrid and was trying to change the style of an individual column(cell) after changing another cellvalue. For example I have a grid with a shipname and shipcity column. Suppose I have a business rule that says :

'Make shipcity cell value disabled when the shipname on the same row has the same value'

我发现此示例使用了我可能使用的模糊事件,这是实现此规则的一种好方法吗?

I found this sample which uses the blur event which I probably use, what would be a good way of implementing this rule?

很高兴得知您对asp.net mvc集成的看法.

Also nice to know your opinion in relation to asp.net mvc integration.

jsfiddle链接: http://jsfiddle.net/dingen2010/begjT/1/

jsfiddle link:http://jsfiddle.net/dingen2010/begjT/1/

推荐答案

开箱即用不支持基本条件编辑器模板.您有两种选择.

Basically conditional editor templates are not supported out of the box. You have two options.

使用 编辑 事件Grid的网格找到 e.containder 内的编辑器,并按需要禁用它(如果使用Kendo小部件,请使用enable(false)方法;如果常规输入,请添加readonly属性).

Either use the edit event of the Grid find the editor inside e.containder and disable it the way it needs to be (if using Kendo widget use the enable(false) method, or add the readonly attribute if regular input).

其他选择是定义自定义编辑器,如此JsBin示例中所示.

The other options is to define custom editor like demonstrated in this JsBin example.

这篇关于在KendoGrid中更改单元格样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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