我在对话框中有一个 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/