gpt4 book ai didi

jquery - jqgrid v4.4.5 rtl水平

转载 作者:行者123 更新时间:2023-12-01 05:55:40 25 4
gpt4 key购买 nike

enter image description here我使用jqgrid v4.4.5和jquery v1.9.1。当我调整 jqgrid 的大小并且出现水平滚动条时,它可以在 IE 和 Firefox 上运行。但在 Chrome 中不起作用,列被截断并且宽度计算错误。

我该如何解决这个问题?

<script>

$(function () {
$("#UsersGrid").jqGrid({
direction:"rtl",
url: 'jqGridHandler.ashx',
datatype: 'json',
height: 250,
colNames: ['UserID', 'UserName', 'FirstName', 'MiddleName', 'LastName', 'EmailID'],
colModel: [
{ name: 'UserID', index: 'UserID', width: 100, sortable: true },
{ name: 'UserName', width: 100, sortable: true },
{ name: 'FirstName', width: 100, sortable: true },
{ name: 'MiddleName', width: 100, sortable: true },
{ name: 'LastName', width: 100, sortable: true },
{ name: 'EmailID', width: 150, sortable: true }
],
rowNum: 10,
rowList: [10, 20, 30],
pager: '#UsersGridPager',
sortname: 'UserID',
viewrecords: true,
sortorder: 'asc',
caption: 'JSON Example'
});

$("#UsersGrid").jqGrid('navGrid', '#UsersGridPager', { edit: false, add: false, del: false });
});
</script>

enter image description here

最佳答案

documentation 中所示shr​​inkToFit 属性如果设置,则定义如何重新计算网格列的宽度,同时考虑网格的宽度。如果该值为 true,并且还设置了列的宽度,则每列将按其宽度的比例缩放。

When set to true, the grid width is recalculated automatically to the width of the parent element. This is done only initially when the grid is created. In order to resize the grid when the parent element changes width you should apply custom code and use a setGridWidth method for this purpose.

因此,您只需将属性添加到 jqGrid 即可:

shrinkToFit:true,

关于jquery - jqgrid v4.4.5 rtl水平,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16034005/

25 4 0
文章推荐: jquery - CCS3 转换和 jQuerytoggleClass 溢出 :hidden doesnt work
文章推荐: jquery - 将另一个 CSS 文件应用到特定的
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com