EasyUI Forum
May 07, 2024, 11:43:16 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: Datagrid only one column permanent 100% width  (Read 6944 times)
tmark
Newbie
*
Posts: 7


View Profile
« on: May 05, 2013, 10:29:34 AM »

Hi all

I have only one column in a datagrid.
When I resize the datagrid, the column does not follow it.

At first, how can I set 100% width of the column?
And at second, is it possible to have a permanent 100% width column in the datagrid?

Thanks.
Logged
Kevin
Jr. Member
**
Posts: 52


View Profile Email
« Reply #1 on: May 13, 2013, 06:18:35 AM »

Hi tmark

Try using the fitColumns option. ie
Code:
<table id="dg" class="easyui-datagrid" title="DataGrid with Toolbar" data-options="fitColumns:true, fit:true">  
   <thead> 
      <tr> 
         <th field="itemid" width="100%">Col 1</th> 
      </tr>                           
   </thead>                             
   <tbody>                             
      <tr>                             
         <td>7</td>             
      </tr>                           
   </tbody>                             
</table> 

Note: I had to set the column width to 100%. Without this, the column width is first set to a calculated width (header text width). Then when you resize the column (does not matter what size), it automatically jumps to the max size.
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!