0

Im using jqgrid in my rails project.Using jqgrid in different pages for different recorsd.In one page I need different font size and in another page I need different font size.So here I can not change the css of jqgrid.I need to change the fond size dynamically in my view code.I need to change the header,record and footer fonts.Can any one suggest me the way to do it.

2
  • I have solved the problem by my own.Applied the following in the view , <script>.ui-jqgrid tr.jqgrow td {font-size:0.7em} .ui-jqgrid .ui-jqgrid-htable th div { font-size:0.7em} .ui-jqgrid .ui-paging-info { font-size:0.5em} .ui-jqgrid .ui-pg-input { height: 19px ; font-size :0.7em}; .ui-jqgrid .ui-pg-selbox { height: 19px ; font-size :0.7em};</script>
    – karthi_ms
    Apr 3, 2012 at 6:50
  • Sorry, but it's far from the full solution like you formulate your question. You should definitively remove px from height, change the paging values. You don't specify whether you use top pager or not, tree grid and other jqGrid features. Do use need to adjust fonts in alert dialogs or forms and searching dialogs, searching toolbar, frozen columns and so on? Even for the simplest grid the setting which you post are not full. Just try to set font-size:48px; to see more clear where you have problems.
    – Oleg
    Apr 3, 2012 at 7:37

1 Answer 1

0

It's not easy. The current code of jqGrid don't use px instead of em. There are options like scrollOffset or cellLayout to be able to fix problems with wrong calculation of column width. 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. 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. If you do did this it would be good if you share the solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.