123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- @{
- ViewBag.Title = "换标操作";
- Layout = "~/Views/Shared/_Index.cshtml";
- }
- <style>
- .ui-jqgrid tr.jqgrow td {
- white-space: normal !important;
- height: auto;
- }
- </style>
- <script>
- $(document).ready(function () {
- initialPage();
- GetGrid();
- });
- //重设(表格)宽高
- function initialPage() {
- //resize重设(表格、树形)宽高
- $(window).resize(function (e) {
- window.setTimeout(function () {
- $('#gridTable').setGridWidth(($('.gridPanel').width()));
- $("#gridTable").setGridHeight($(window).height() - 108.5);
- }, 200);
- e.stopPropagation();
- });
- }
- //加载表格
- function GetGrid() {
- var selectedRowIndex = 0;
- var $gridTable = $('#gridTable');
- $gridTable.jqGrid({
- url: "/NBManage/NBCommandHis/GetCmdHis?id=" + @ViewBag.id + "&cmdType="+@ViewBag.cmdType,
- datatype: "json",
- height: $(window).height() - 108.5,
- autowidth: true,
- colModel: [
- { label: '命令ID', name: 'CmdID', width: 300, align: "left", sortable: false },
- { label: '发送时间', name: 'SendTime',width: 150, align: "left", sortable: false },
- { label: "更新时间", name: "RecvTime", width: 150, align: "left", sortable: false },
- { label: "发送报文", name: "SendText", width: 450, align: "left", sortable: false ,
- formatter: function (cellvalue, options, rowObject) {
- return JSON.stringify($.parseJSON(cellvalue).command)
- }
- },
- { label: "命令状态", name: "CmdResult", width: 100, align: "left", sortable: false },
- { label: "响应内容", name: "ReturnText", width: 100, align: "left", sortable: false }
- ],
- viewrecords: true,
- rowNum: 10,
- rowList: [5,10,15,20,30, 50, 100],
- pager: "#gridPager",
- gridview: true,
- rownumbers: true
- });
-
- }
- </script>
- <div class="gridPanel">
- <table id="gridTable"></table>
- <div id="gridPager"></div>
- </div>
|