EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on January 29, 2015, 07:28:47 PM



Title: datagrid final column fit to width [Solved]
Post by: devnull 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


Title: Re: datagrid final column fit to width
Post by: jarry 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>


Title: Re: datagrid final column fit to width [Solved]
Post by: devnull on February 03, 2015, 07:26:10 AM
Great, thank you.