Ear*_*rlz 40 javascript css jquery jqgrid
是否有可能使jqGrid的宽度设置为100%?我知道列宽必须是绝对像素大小,但我还没有找到任何用于将实际网格的宽度设置为相对大小的内容.例如,我想将宽度设置为100%.它似乎使用450px的奇数尺寸,而不是100%.页面上有更多的水平空间,但是如果列宽等等,它将使容器(仅网格)水平滚动.这有什么办法吗?
我正在使用它将网格的宽度设置为父容器的宽度.
function resizeGrid() {
var $grid = $("#list"),
newWidth = $grid.closest(".ui-jqgrid").parent().width();
$grid.jqGrid("setGridWidth", newWidth, true);
}
Run Code Online (Sandbox Code Playgroud)