JqG​​rid和自定义类 [英] JqGrid and custom classes

查看:161
本文介绍了JqG​​rid和自定义类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有可能调整jqGrid以在EditForm中的输入中添加一些类吗?例如,我可以通过在 colModel 节中指定属性 classes 来为单元格添加类。而且我想知道,输入存在类似的机制吗?

解决方案

没有确切的属性 ,其中添加了CSS类'ui-state-highlight''Client'字段和'Tax'字段的类'ui-state-error' >

Is it possible to tune jqGrid to add some classes to inputs in EditForm? For example, I can add classes to cells by specifying property classes in colModel section. And I want to know, is similar mechanism for inputs exist?

解决方案

There are no exact property like classes in colModel, but you can use dataInit callback of editoptions to add the class or do other kind of initializing action on the input fields. For example the code

editoptions: { dataInit: function (elem) { $(elem).addClass('ui-state-highlight');

add predefined 'ui-state-highlight' class of jQuery UI (see here) to the input box. As the result you can receive the result like the following

See the demo where I added CSS class 'ui-state-highlight' to the 'Client' field and the class 'ui-state-error' to the 'Tax' field.

这篇关于JqG​​rid和自定义类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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