javascript - 调整大小时对话框内 js-GRID 的错误行为

标签 javascript jquery dialog resize jsgrid

我在对话框中有一个 js-GRID,当我调整它的大小时,js-GRID 的外观会发生变化。

这是我的 js-GRID 第一次加载时的样子:

loaded js-GRID for the first time

这就是我的 js-GRID 尝试增加对话框后的样子:

js-GRID after resizing the dialog

这是此对话框中我的 js-GRID 的初始化代码。

$("#DataGrid").dialog({
    minWidth: 1240,
    minHeight: 600
});
$("#DataGrid").jsGrid({
    height: "100%",
    width: "70%",
    filtering: true,
    editing: true,
    inserting: true,
    sorting: true,
    paging: true,
    autoload: true,
    pageSize: 15,
    pageButtonCount: 5,
    datatype: "json",
    deleteConfirm: "Do you really want to delete the row?",
    controller: process_variables,
    ....................................................

如何在加载 js-GRID 和对话框时同时获得 js-GRID 和对话框的默认大小值,并同时调整其大小以正确自动调整对话框和 js-GRID 的大小?

最佳答案

我通过进行以下更改解决了我的问题:

$("#DataGrid").dialog({
    minWidth: 1240,
    minHeight: 600
});
$("#DataGrid").jsGrid({
    height: "auto",
    width: "70%",
    filtering: true,
    editing: true,
    inserting: true,
    sorting: true,
    paging: true,
    autoload: true,
    pageSize: 15,
    pageButtonCount: 5,
    datatype: "json",
    deleteConfirm: "Do you really want to delete the row?",
    controller: process_variables,
    ....................................................

关于javascript - 调整大小时对话框内 js-GRID 的错误行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46193560/

相关文章:

javascript - 在 JavaScript 中使数字值相反

javascript - 织物弯曲文本间距/字距调整问题

javascript - 某些网页无法在 JavaFX webview/webengine 中正确加载

flutter - 如何从 flutter 的对话框中获取值?

javascript - 使用单个 ajax() 调用填充多个 div,表单提交按钮失败

javascript - jquery .html()函数没有给出数据属性设置值

jquery - 使用 jQuery 插入表格列

javascript - 单击javascript关闭 Accordion

java - 如何将 HTML 嵌入到 Java 自定义对话框中?

c# - 在 ShowDialog() 中禁用 Alt + F4