JqGrid : Customize column name display

自作多情 提交于 2019-12-25 03:58:50

问题


I have a jqgrid in the which i display some info..

My column name should appear in the same way as below

    Canada          Australia
Month / Year     Month / Year

Tha is how i need to display my columns each column name should display Month/Year below it.

as of now my code looks like

  colnames: [Id,Canada,Australia,Usa]

回答1:


It's depend on what you need exactly. The text from colNames items is in general HTML fragment. So you can use <br/> for example:

colNames: ["Id", "Canada<br/>Month / Year", "Australia<br/>Month / Year",
           "Usa<br/>Month / Year"]

To have the height of the column headers increased you could include CSS like

.ui-jqgrid .ui-jqgrid-htable th div { height: auto }

after ui.jqgrid.css.

Alternatively you could want that the text in column header will be wrapped. The case are discussed before in the answer.



来源:https://stackoverflow.com/questions/24597410/jqgrid-customize-column-name-display

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