EasyUI Forum
April 22, 2024, 11:42:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Multiple row in thead  (Read 22802 times)
asulhyan
Newbie
*
Posts: 4


View Profile Email
« on: July 20, 2011, 03:56:18 PM »

I want to know if I want to have multiple row columns in thead; how it can be achieved. I want to do something like below.
Is this supported ? What is the purpose of the columns being a double array, as per my understanding as represented below, I tried to use it for separate rows ? thanks

---------

$('#tablett').datagrid({
                                        title:'test',
               width:500,
               height:height,
               nowrap: true,
               striped: true,
               collapsible:false,               
                        columns:[[{field:'tt1',title:'test1', width: 100}],
                        [ {field:'tt2',title:'TT2', width: 40}, { field:'tt3',title:'TT3', width: 20} ]]
-----
<table>
        <thead>
        <tr>
                <th colspan="2">Test1</th>
        </tr>
        <tr>
                <th >Test2</th>
                <th >Test3</th>
        </tr>
        </thead>
        <tbody>
                <tr>
                <td >data2</td>
                <td >data3</td>
        </tr>
                        <tr>
                <td >data5</td>
                <td >data6</td>
        </tr>
        <tbody>
</table>
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 20, 2011, 08:25:11 PM »

Here is a tutorial on how to create multiple row head for datagrid.

http://www.jeasyui.com/tutorial/datagrid/datagrid9.php
Logged
asulhyan
Newbie
*
Posts: 4


View Profile Email
« Reply #2 on: July 21, 2011, 09:04:27 AM »

thanks, that helps. I was doing a mistake of specifying the field id where I was using the colspan; which I think was asking the function to take its width. That appears to be working now.

Now, my next issue I want to specify td height. I don't see the height property here: http://www.jeasyui.com/documentation/index.php#
I want to specify the td height to the place where I colspan. Something like:
<th colspan="4" style="height: 100px">Item Details</th>

Logged
asulhyan
Newbie
*
Posts: 4


View Profile Email
« Reply #3 on: July 21, 2011, 11:02:50 AM »

As a short term solution for my earlier response I am doing the below. I would appreciate if there is a cleaner way to achieve it. thanks.

$( '.datagrid-header' )
.children( 'div' )
.children( 'table' )
.children( 'tbody' )
.children( 'tr::nth-child(1)' )
.css('height','30px');
Logged
asulhyan
Newbie
*
Posts: 4


View Profile Email
« Reply #4 on: July 21, 2011, 11:06:39 AM »

Though I gave example of height attribute. I would like to know if we can add it using style as I will also be adding custom styles to below:
$( '.datagrid-header' )
.children( 'div' )
.children( 'table' )
.children( 'tbody' )
.children( 'tr::nth-child(1)' )
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!