change cell styling in KendoGrid

2019-08-28 20:44发布

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?

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

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

2条回答
相关推荐>>
2楼-- · 2019-08-28 21:08

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

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).

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

查看更多
等我变得足够好
3楼-- · 2019-08-28 21:14

Updated the link:

You can try the updated fiddle example here

查看更多
登录 后发表回答