jQuery EasyUI:使数据网格在边框布局中可调整大小

问题描述 投票:2回答:1

我正在尝试使用EasyUI实现主细节控制。目前我有以下内容:

<div class="easyui-layout" style="height: 600px;">
    <div region="west" style="width: 250px;">
        <table id="detailsTable">
            <thead>
                <tr>
                    <th field="ID" width="200">ID</th>
                    <th field="Name" width="200">Name</th>
                </tr>
            </thead>
            <tbody>
            ...
            </tbody>
        </table>
    </div>
    <div region="center" title="Main Title">
    ...
    </div>
</div>

以下脚本将上面的内容转换为漂亮的主 - 细节控件:

$("div.easyui-layout").layout();
$("table#detailsTable").datagrid({
    pagination: false,
    singleSelect: true,
    fitColumns: true
});

我现在需要的是使网格的宽度为其容器的100%(西部面板),因此需要与面板一起调整大小。为表格设置width="100%"style="width: 100%;"没有帮助,并且在调整面板大小时布局似乎不会触发任何事件(至少我在文档中没有找到任何事件)。有任何想法吗?

datagrid jquery-easyui
1个回答
0
投票

(在评论和编辑中回答。见Question with no answers, but issue solved in the comments (or extended in chat)

OP写道:

看起来可以关闭案例 - 适合选项解决了问题:

$("table#detailsTable").datagrid({
    fit: true,
    ...
© www.soinside.com 2019 - 2024. All rights reserved.