【问题标题】:jQuery EasyUI: make datagrid resizable inside border layoutjQuery EasyUI:使数据网格在边框布局内可调整大小
【发布时间】:2012-07-01 00:48:18
【问题描述】:

我正在尝试使用 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】:

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

    OP 写道:

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

    $("table#detailsTable").datagrid({
        fit: true,
        ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-19
      相关资源
      最近更新 更多