JqGrid and custom classes

自作多情 提交于 2019-12-25 06:50:00

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/8895802/jqgrid-and-custom-classes

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