EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: ejzhang on March 19, 2013, 08:11:59 AM



Title: How to wrap datagrid's colume title?
Post by: ejzhang on March 19, 2013, 08:11:59 AM
I use the "<br />" tag, but the first line can be shown only.
Code:
columns:[[
{title:'<strong>序号</strong>',field:'ID',rowspan:2,width:38,align:'center'},
{title:'<strong>班组名称</strong>',rowspan:2,width:78,align:'center'},
{title:'<strong>作业小组名称</strong>',field:'Squad',rowspan:2,width:88,align:'center'},
{title:'<strong>人数</strong>',field:'NumOfMems',rowspan:2,width:38,align:'center'},
{title:'<strong>班组长<br />姓名</strong>',field:'Leader',rowspan:2,width:68,align:'center'},
{title:'<strong>职名</strong>',field:'Post',rowspan:2,width:58,align:'center'},
{title:'<strong>分类</strong>',colspan:2,align:'center'},
{title:'<strong>津贴</strong>',colspan:2,align:'center'},
{title:'<strong>考核<br />金额</strong>',field:'Assess',rowspan:2,width:38,align:'center'},
{title:'<strong>实发班组<br />长津贴</strong>',rowspan:2,width:58,align:'center'},
{title:'<strong>考核或异动原因</strong>',field:'Notes',rowspan:2,width:88,align:'center'}
],[
{title:'<strong>正<br />班<br />组<br />长</strong>',field:'Chief',width:18,align:'center'},
{title:'<strong>副<br />班<br />组<br />长</strong>',field:'Vice',width:18,align:'center'},
{title:'<strong>XX元<br />(一类)</strong>',field:'Class1',width:38,align:'center'},
{title:'<strong>XX元<br />(二类)</strong>',field:'Class2',width:38,align:'center'}
]]


Title: Re: How to wrap datagrid's colume title?
Post by: stworthy on March 19, 2013, 07:00:47 PM
Please include the following code to your page:
Code:
	<style type="text/css">
.datagrid-header .datagrid-cell{
height:auto;
line-height:auto;
}
</style>


Title: Re: How to wrap datagrid's colume title?
Post by: ejzhang on March 19, 2013, 08:13:12 PM
thanks!
btw:these css attribute shoud be default.