gpt4 book ai didi

jquery - 使 JqGrid 宽度流畅

转载 作者:行者123 更新时间:2023-11-28 11:32:25 25 4
gpt4 key购买 nike

<分区>

更正代码:

<script>
var $grid = $("#list2");
emptyMsgDiv = $("<div><span style='color:red; text-align:center;font-size:18px;display:block;'>No Workorder Found</span></div>");
jQuery("#list2").jqGrid({
url:'server.php',
datatype: "json",
mtype: 'POST',
colNames:['WO#','Status','Customer Name','Salesman', 'Created Date', 'WO Total', 'Notes', 'Edit'],
colModel:[
{name:'id',index:'id', align:"center"},
{name:'status1',index:'status1', align:"center", width:100},
{name:'status2',index:'status2', align:"center", width:50},
{name:'status3',index:'status3', align:"center"},
{name:'result',index:'result', align:"center", sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager2',
sortname: 'Invoice.id',
viewrecords: true,
height:'100%',
autowidth:true,
sortorder: "desc",
height: '100%',
loadComplete: function() {
var ts = this;
if (ts.p.reccount === 0) {
$(this).hide();
emptyMsgDiv.show();
} else {
$(this).show();
emptyMsgDiv.hide();
}
}
});
emptyMsgDiv.insertAfter($grid.parent());
</script>

这是我的 JqGrid 代码:

<script>
var $grid = $("#list2");
emptyMsgDiv = $("<div><span style='color:red; text-align:center;font-size:18px;display:block;'>No Workorder Found</span></div>");
jQuery("#list2").jqGrid({
url:'server.php',
datatype: "json",
mtype: 'POST',
colNames:['WO#','Status','Customer Name','Salesman', 'Created Date', 'WO Total', 'Notes', 'Edit'],
colModel:[
{name:'id',index:'id', align:"center"},
{name:'status1',index:'status1', align:"center"},
{name:'status2',index:'status2', align:"center"},
{name:'status3',index:'status3', align:"center"},
{name:'result',index:'result', align:"center", sortable:false}
],
rowNum:10,
rowList:[10,20,30],
pager: '#pager2',
sortname: 'Invoice.id',
viewrecords: true,
height:'100%',
sortorder: "desc",
height: '100%',
loadComplete: function() {
var ts = this;
if (ts.p.reccount === 0) {
$(this).hide();
emptyMsgDiv.show();
} else {
$(this).show();
emptyMsgDiv.hide();
}
}
});
emptyMsgDiv.insertAfter($grid.parent());
</script>

我正在尝试为页面制作 colModel 流体宽度,我可以手动更改每一列的宽度,如下面的花絮:

{name:'status1',index:'status1', align:"center", width:50}

但是,我无法定义百分比,或者似乎无法弄清楚如何进行流体宽度。有人有什么想法吗?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com