jqgrid 自动换行

来源:互联网 发布:淘宝qq飞车包车 编辑:程序博客网 时间:2024/05/22 06:49

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel="stylesheet" type="text/css" media="screen" href="jquery/jqgrid/css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" href="jquery/jquery-ui/css/redmond/jquery-ui-1.8.16.custom.css" />

<script type="text/javascript" src="jquery/jquery-1.6.2.min.js"></script>
<script src="jquery/jqgrid/js/i18n/grid.locale-cn.js" type="text/javascript"></script>
<script type="text/javascript" src="jquery/jquery-ui/js/jquery-ui-1.8.16.custom.min.js"></script>
<script src="jquery/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>

<script type="text/javascript">
$(function() {
 $("#detailAudit_grid").jqGrid({
  url: 'getDetailData.action?id=${id}',
  datatype: 'json',
  altRows: true,
  altclass: 'zebra-striped',
  mtype:"GET",
  colNames: ["名称", "描述"],
  colModel: [
   {name: 'key',index: 'key', width: 120, hidden: false, sortable: false},
   {name: 'value',index: 'value', width: 310, hidden: false, sortable: false}
  ],
  height: 219,
  autowidth: true,
  jsonReader:{
   repeatitems : false
  }
 });
});
</script>

<style type="text/css">
.zebra-striped {
 background: #efefff 50% 50% repeat-x;
}
</style>
<style>
html, body {
        margin: 0;
        padding: 0;
        font-size: 100%;
}
</style>
<style>
.ui-jqgrid tr.jqgrow td {
  white-space: normal !important;
  height:auto;
  vertical-align:text-top;
  padding-top:2px;
 }
</style>
<title>查看详情</title>
</head>
<body>
 <div class="content">
  <table id="detailAudit_grid"></table>
 </div>
</body>
</html>

0 0