简体   繁体   English

如何动态更改jqgrid字体大小

[英]How to change jqgrid font size dynamically

我在我的rails项目中使用jqgrid。在不同的页面中使用jqgrid进行了不同的recrors。在一个页面中我需要不同的字体大小,在另一页面中我需要不同的字体大小。在我的视图代码中动态更改喜欢的大小。我需要更改页眉,记录和页脚字体。任何人都可以建议我这样做的方法。

It's not easy. 这并不容易。 The current code of jqGrid don't use px instead of em . jqGrid的当前代码不使用px而不是em There are options like scrollOffset or cellLayout to be able to fix problems with wrong calculation of column width. 有诸如scrollOffsetcellLayout类的选项可以解决错误计算列宽的问题。 So to solve the problem with dynamically font size one have to adjust the width or height of grid and not only to change jqGrid.css . 因此,要解决动态字体大小的问题,不仅要更改jqGrid.css,还必须调整网格的宽度或高度。 If you don't do this the grid can have unneeded scroll bars. 如果您不这样做,则网格可以具有不需要的滚动条。

Shortly I don't recommend you to try to implement dynamic font size in jqGrid because of complexity of the problem. 不久,由于问题的复杂性,我不建议您尝试在jqGrid中实现动态字体大小。 If you do did this it would be good if you share the solution. 如果您这样做,则最好共享解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM