EasyUI Forum
September 13, 2025, 10:01:06 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: datagrid final column fit to width [Solved]  (Read 11536 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: January 29, 2015, 07:28:47 PM »

How can I make the final column in a datagrid fit the remaining available table width ?

Thanks
« Last Edit: February 03, 2015, 07:25:50 AM by devnull » Logged

-- Licensed User --
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: January 30, 2015, 05:35:01 AM »

Set 'fixed' property to true for all the columns except the last column and then set 'fitColumns' property to true for the datagrid.
Code:
<table class="easyui-datagrid" title="DataGrid" fitColumns="true" style="width:700px;height:250px">
    <thead>
        <tr>
            <th data-options="field:'itemid',width:80,fixed:true">Item ID</th>
            <th data-options="field:'productid',width:100,fixed:true">Product</th>
            <th data-options="field:'listprice',width:80,align:'right',fixed:true">List Price</th>
            <th data-options="field:'unitcost',width:80,align:'right',fixed:true">Unit Cost</th>
            <th data-options="field:'attr1',width:250">Attribute</th>
        </tr>
    </thead>
</table>
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 on: February 03, 2015, 07:26:10 AM »

Great, thank you.
Logged

-- Licensed User --
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!