效果如图:

js代码:

$("#tdg").datagrid({
            width: 200,
            url: "/Laboratory/ShipmentRegister/LoadData",
            queryParams: {
                auvp: 'r',
                condition: "  and State='0'  "
            },
            striped: true,
            remoteSort: false,
            singleSelect: true,
            nowrap: false,
            fitColumns: false,
            columns: [[
                //{ field: 'ck', checkbox: true },
                { field: 'JobNo', align: 'center', title: '计划单号', width: '120' },
                { field: 'CustomerName', align: 'center', title: '客户名称', width: '150' },
                { field: 'SiteName', align: 'center', title: '工地名称', width: '150' },
                { field: 'Project', align: 'center', title: '工程部位', width: '80' },
                { field: 'Cgrade', align: 'center', title: '混凝土级别', width: '75' },
                { field: 'ActSlumpName', align: 'center', title: '实测塌落度', width: '100' },
                { field: 'Volume', align: 'left', title: '生产方量', width: '60' },
            ]],
            fit: true,
            view: detailview,
            detailFormatter: function (rowIndex, rowData) {
                return '<div><table id="tt_' + rowData.Autoid + '"></table></div>';
            },
            onExpandRow: function (index, row) {
                $("#tt_" + row.Autoid).datagrid({
                    width: 'auto',
                    height: 'auto',
                    url: "/Laboratory/ShipmentRegister/LoadProdData",
                    queryParams: {
                        JobNo: row.JobNo
                    },
                    striped: true,
                    remoteSort: false,
                    singleSelect: true,
                    nowrap: false,
                    fitColumns: false,
                    columns: [[
                        { field: 'PDate', align: 'center', title: '发货时间', width: '150' },
                        { field: 'DocketNo', align: 'center', title: '送货单号', width: '150' },
                        { field: 'TruckName', align: 'center', title: '车号', width: '150' },
                        { field: 'Volume', align: 'center', title: '销售方量', width: '80' },
                        { field: 'TruckCount', align: 'center', title: '车次', width: '75' },
                        { field: 'Total', align: 'center', title: '累计方量', width: '100' }
                    ]],
                    //fit: true, //自适应大小,填充容器  如果fit为true,则视图显示不出来。所以此处把fit属性注释起来
                    onResize: function () {
                        $('#tdg').datagrid('fixDetailRowHeight', index);
                    }, onLoadSuccess: function (data) {
      //此处必须有否则第一次展开时"+"号不会跟着移动
                        setTimeout(function () {
                            $('#tdg').datagrid('fixDetailRowHeight', index);
                        },0);
                    }
                });
                $('#tdg').datagrid('fixDetailRowHeight', index);
            },
            onCollapseRow: function (index, row) {
                //alert(index);
            }
        })

当属性fit: true时,展开视图会变成如下图所示的效果:

easyui 扩展 datagrid 数据网格视图的更多相关文章

  1. 数据网格和树-EasyUI Datagrid 数据网格、EasyUI Propertygrid 属性网格、EasyUI Tree 树、EasyUI Treegrid 树形网格

    EasyUI Datagrid 数据网格 扩展自 $.fn.panel.defaults.通过 $.fn.datagrid.defaults 重写默认的 defaults. 数据网格(datagrid ...

  2. 第二百二十二节,jQuery EasyUI,DataGrid(数据表格)组件

    jQuery EasyUI,DataGrid(数据表格)组件 学习要点: 1.加载方式 2.分页功能 本节课重点了解 EasyUI 中 DataGrid(数据表格)组件的使用方法,这个组件依赖于 Pa ...

  3. EasyUI:datagrid数据汇总

    EasyUI:datagrid数据汇总 js代码: var total=0;//全局变量 $(function(){ $('#tablebudgetdata').datagrid({ title:' ...

  4. easyui数据网格视图(Datagrid View)的简单应用

    下面介绍datagrid的数据网格详细视图和数据网格的分组视图 1.先引用的js和css文件 1)包含eauyui必备的四个文件easyui.css,icon.css, jquery-min.js.j ...

  5. jquery Easy UI Datagrid(数据网格)学习心德,附API

    第一步,引入主要的css样式和js文件 <meta http-equiv="Content-Type" content="text/html; charset=ut ...

  6. 利用Aspose.Cells完成easyUI中DataGrid数据的Excel导出功能

    我准备在项目中实现该功能之前,google发现大部分代码都是利用一般处理程序HttpHandler实现的服务器端数据的Excel导出,但是这样存在的问题是ashx读取的数据一般都是数据库中视图的数据, ...

  7. EasyUI Datagrid 数据网格

    前端用easyUI开发时,官方给的文档指导太少,网上找的又很慢,因此,我总结了一个后台返回数据后,用easyUI生成表格的方法,可编辑可分页: 1 function paginationTable(i ...

  8. easyui datagrid数据网格

    EasyUI是一组基于jQuery的UI插件集合,它的目标就是帮助web开发者更轻松的打造出功能丰富并且美观的UI界面.它的许多控件让我们不必写很复杂的javascript,从而极大地提高了开发效率. ...

  9. EasyUI Datagrid 数据网格 点击选中行 再次单击取消选中行

    适用于jquery-easyui-1.9.15版本: 在项目中全局搜索: opts.singleSelect==true 或者在jquery.easyui.min.js中搜索: opts.single ...

随机推荐

  1. 微信小程序踩坑日记3——上传照片至服务器

    0. 引言 主要解决将小程序端获取的图片保存在服务器上.亲测可用的服务端脚本. 1. 获取照片 通过wx.chooseImage()方法,获取到图片,使用wx.uploadFile()上传图片. wx ...

  2. java 和 spring 的异步

    spring 的 async 注解 https://www.baeldung.com/spring-async@Async will make it execute in a separate thr ...

  3. Asp.Net Core 开发之旅之.net core 连接数据库

    数据库连接字符串放入配置文件中 打开appsettings.json 添加ConnectionStrings 例子如下: { "Logging": { "IncludeS ...

  4. [Go] vscode配置Go环境

    首先要先把环境变量配置好,配置好环境变量打开go文件的时候,会自动提示需要安装的扩展在/root/.profile和/home/当前用户/.profile都加上 export GOPATH=/var/ ...

  5. cobalt strike入门和防护

    1.入门: https://blog.csdn.net/localhost01/article/details/86741124 2.cs的防护: 由于关乎渗透人员自身的安全,建议大家好好看看,这里贴 ...

  6. Shell命令-用户用户组管理之visudo、sudo

    文件及内容处理 - visudo.sudo 1. visudo:编辑/etc/sudoers文件的专属命令 visudo命令的功能说明 visudo命令专门用来编辑/etc/sudoers这个文件的. ...

  7. CentOS7 安装Jenkins

    准备工作 首选需要安装JAVA环境  https://www.cnblogs.com/stulzq/p/9286878.html 如果你的系统没有自带git,那么也需要安装一个 yum install ...

  8. 在Rust中使用C语言的库功能

    主要是了解unsafe{}语法块的作用. #[repr(C)] #[derive(Copy, Clone)] #[derive(Debug)] struct Complex { re: f32, im ...

  9. template might not exist or might not be accessible by any of the configured Template Resolvers at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:869)

    org.thymeleaf.exceptions.TemplateInputException: Error resolving template [code/leading], template m ...

  10. python批量json文件转xml文件脚本(附代码)

    场景:在使用了mask rcnn跑实验后标注了大量地json格式文件,现在打算使用yolo和faster rcnn 跑实验 所以需要将之前地json文件转为xml     但是找了很久,没发现有批量处 ...