jqgrid自定义行颜色
如何使用自定义格式化程序设置整行(而不仅仅是单元格)的背景颜色?
How can I set the background-color of an entire row (not just cell) using the custom formatter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
自定义格式化程序用于格式化单元格的数据(= 文本)。据我所知,他们不知道实际的单元格(意思是 jquery 对象),但只知道它的值。
但通常 jqGrid 会为所有行分配 ID,因此如果您知道行 ID,则设置背景颜色应该只需设置该行的所有 td 子元素的背景颜色即可。
The custom formatters are used for formatting the cell's data (= text). As far as I know they don't know about the actual cell (meaning a jquery object) but only of it's value.
But usually jqGrid assigns IDs to all rows so setting the background color if you know the rows ID should be only a matter of setting the background color of all td child elements of this row.