+ -
当前位置:首页 → 问答吧 → jQuery EasyUI的datagrid如何自适应高度

jQuery EasyUI的datagrid如何自适应高度

时间:2011-01-20

来源:互联网

HTML code
<table id="tt" width="100%" height="100%" title="Editable DataGrid" iconCls="icon-edit" singleSelect="true" idField="itemid" url="datagrid_data2.asp" pagination="true" rownumbers="true">
        <thead>
            <tr>
                <th field="itemid" width="80" checkbox="true">Item ID</th>
                <th field="productid" width="100">Product</th>
                <th field="listprice" width="80" align="right">List Price</th>
                <th field="unitcost" width="80" align="right">Unit Cost</th>
                <th field="attr1" width="150">Attribute</th>
                <th field="status" width="60" align="center">Status</th>
            </tr>
        </thead>
    </table>

只能自适应宽度,高度不能自适应

作者: assdeng   发布时间: 2011-01-20

不知道jq将table结构改成什么样了,如果知道结构,再加载数据完毕后,获取table容器的scrollHeight,然后再设置容器的height就可以自适应高度了

作者: showbo   发布时间: 2011-01-21

不太明白

作者: liu3660052   发布时间: 2011-01-21

引用 2 楼 liu3660052 的回复:
不太明白


me too

作者: assdeng   发布时间: 2011-01-21