EasyUI Forum
April 27, 2024, 02:27:46 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Multiline datagrid header only shows one line in 1.3.2  (Read 14682 times)
Kevin
Jr. Member
**
Posts: 52


View Profile Email
« on: January 22, 2013, 02:26:12 PM »

In all previous versions, it was possible to create a multilined datagrid header by just inserting a <br> tag in the title. Multiline headers are extremely helpful if you have many columns with 'long' heading names. Thus splitting them up into 2 lines will technically halve the width of the table. The following code creates a 2 line header in V1.3.1, but you only see the 1st line in V1.3.2
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test</title>
<link href="http://www.jeasyui.com/easyui/themes/default/easyui.css" type="text/css" rel="stylesheet" />
<script src="http://code.jquery.com/jquery-1.8.0.min.js" type="text/javascript"></script>
<script src="http://www.jeasyui.com/easyui/jquery.easyui.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
   $('#test').datagrid({
      fit: true,
      columns: [[
         { field: 'col1', title: 'Col 1<br>Next',width: 100},
         { field: 'col2', title: 'Col 2', width: 100}
      ]]
   });
});
</script>
</head>
<body>
   <table id="test"></table>
</body>
</html>
This has been tested with IE,FF and Chrome - same results. I've also tried creating the table with HTML which also only displays 1 line in the header.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 22, 2013, 07:05:01 PM »

The header cells and body cells have the same height in version 1.3.2. This makes the datagrid looks more nice. To enable multi-line header, please include the <style> below on the page.
Code:
<style type="text/css">
.datagrid-header .datagrid-cell{
line-height:normal;
height:auto;
}
</style>
Logged
Kevin
Jr. Member
**
Posts: 52


View Profile Email
« Reply #2 on: January 23, 2013, 01:45:29 AM »

Thanks very much stworthy, works a treat. I just wish I was half as clever as you Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!