第一种方式:通过HTML标签创建数据表格控件

<table class="easyui-datagrid" title="基本数据表格"
style="width: 700px; height: 250px"
data-options="singleSelect:true,collapsible:true,url:'${pageContext.request.contextPath}/datagridData.do'">
<thead data-options="frozen:true">
<tr>
<th data-options="field:'stuId',width:100">学生ID</th>
<th data-options="field:'stuName',width:100">学生姓名</th>
</tr>
</thead>
<thead>
<tr>
<th data-options="field:'stuSex',width:100">学生性别</th>
<th data-options="field:'stuAge',width:100">学生年龄</th>
<th data-options="field:'stuEmail',width:100,align:'center'">学生邮箱</th>
<th data-options="field:'stuQQ',width:100,align:'right'">学生QQ</th>
<th data-options="field:'stuAddress',width:200,align:'center'">学生地址</th>
</tr>
</thead>
<tbody>
<c:forEach var="student" items="${studentList}">
<tr>
<td>${student.stuId}</td>
<td>${student.stuName}</td>
<td>${student.stuSex}</td>
<td>${student.stuAge}</td>
<td>${student.stuEmail}</td>
<td>${student.stuQQ}</td>
<td>${student.stuAddress}</td>
</tr>
</c:forEach>
</tbody>
</table>

data-options="frozen:true"冻结列

   第二种方式:使用Javascript去创建数据表格控件

<body>
<table id="studentList">
<tbody>
<c:forEach var="student" items="${studentList}">
<tr>
<td>${student.stuId}</td>
<td>${student.stuName}</td>
<td>${student.stuSex}</td>
<td>${student.stuAge}</td>
<td>${student.stuEmail}</td>
<td>${student.stuQQ}</td>
<td>${student.stuAddress}</td>
</tr>
</c:forEach>
</tbody>
</table>
</body>
<script type="text/javascript">
$('#studentList').datagrid({
title : '基本数据表格',
width : 700,
height : 250,
url : '${pageContext.request.contextPath}/datagridData.do',
frozenColumns : [ [ {
field : 'stuId',
title : '学生ID',
width : 100
}, {
field : 'stuName',
title : '学生姓名',
width : 100
} ] ],
columns : [ [ {
field : 'stuSex',
title : '学生性别',
width : 100
}, {
field : 'stuAge',
title : '学生年龄',
width : 100
}, {
field : 'stuEmail',
title : '学生邮箱',
width : 100
}, {
field : 'stuQQ',
title : '学生QQ',
width : 100
}, {
field : 'stuAddress',
title : '学生地址',
width : 200,
align : 'center'
} ] ] });
</script>

frozenColumns属性冻结列

EasyUI创建DataGrid及冻结列的两种方式的更多相关文章

  1. easyui里面的加载tree的两种方式

    第一种: 使用EasyUI中Tree 符合EasyUI中Tree的Json格式,我们先看一下,格式是如何的 [{ "id":1, "text":"My ...

  2. easyui datagrid加载数据的两种方式

    1.加载本地数据 var obj = {"total":2,"rows":[{id:"1",name:"一"},{id: ...

  3. 【Android】创建Popwindow弹出菜单的两种方式

    方法一的Activity package com.app.test02; import android.app.Activity; import android.os.Bundle; import a ...

  4. 【转】android创建Popwindow弹出菜单的两种方式

    方法一的Activity package com.app.test02; import android.app.Activity; import android.os.Bundle; import a ...

  5. linq查询结果指定列的两种方式

    方式一: var results = from product in products orderby product.Price descending select new { product.Na ...

  6. 雷林鹏分享:jQuery EasyUI 数据网格 - 设置冻结列

    jQuery EasyUI 数据网格 - 设置冻结列 本实例演示如何冻结一些列,当用户在网格上移动水平滚动条时,冻结列不能滚动到视图的外部. 为了冻结列,您需要定义 frozenColumns 属性. ...

  7. easyUI之datagrid绑定后端返回数据的两种方式

    先来看一下某一位大佬留下的easyUI的API对datagrid绑定数据的两种方式的介绍. 虽然精简,但是,很具有“师傅领进门,修行靠个人”的精神,先发自内心的赞一个. 但是,很多人和小编一样,第一次 ...

  8. 【java并发】传统线程技术中创建线程的两种方式

    传统的线程技术中有两种创建线程的方式:一是继承Thread类,并重写run()方法:二是实现Runnable接口,覆盖接口中的run()方法,并把Runnable接口的实现扔给Thread.这两种方式 ...

  9. 创建TabHost的两种方式的简单分析

    最近做了一个TabHost的界面,在做的过程中发现了一些问题,故和大家分享一下. 首先我的界面如下: 目前就我所知,创建TabHost有两种方式,第一种是继承TabActivity类,然后用getTa ...

随机推荐

  1. disruptor的并行用法

    实现EventFactory,在newInstance方法中返回,ringBuffer缓冲区中的对象实例:代码如下: public class DTaskFactory implements Even ...

  2. 【python基础】常用的内置函数

    python基础之内置函数 参考: http://www.runoob.com/python/python-built-in-functions.html -zip() zip函数接受任意多个(包括0 ...

  3. 教你使用SQL数据库复制系列(1-7)

    SQL Server 复制系列(文章索引) 一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 前言(Introduction) 复制逻辑结构图(Construction) ...

  4. UVA 1379 - Pitcher Rotation(DP + 贪心)

    题目链接:option=com_onlinejudge&Itemid=8&page=show_problem&problem=4125" rel="nofo ...

  5. 【NMS与IOU代码】

    # -*- coding: utf-8 -*- import numpy as np def IOU1(A,B): #左上右下坐标(x1,y1,x2,y2) w=max(0,min(A[2],B[2] ...

  6. [py][mx]django处理登录逻辑

    浏览器同源策略(same-origin policy) csrf攻击防御核心点总结 django的cookie和session操作-7天免登录 flask操作cookie&django的see ...

  7. DAX/PowerBI系列 - 参数表(Parameter Table) - 大客户分析(Top N)

    DAX/PowerBI系列 - 参数表(Parameter Table) - 大客户分析(Top N) 难度: ★☆☆☆☆(1星) 适用范围: ★★★☆☆(3星) 概况:此文为DAX/PowerBI系 ...

  8. Amazon RDS 上的 Microsoft SQL Server » 导入和导出 SQL Server 数据库

    导入和导出 SQL Server 数据库 Amazon RDS 支持使用完整备份文件 (.bak 文件) 对 Microsoft SQL Server 数据库进行本机备份和还原.您可以在单个便携式文件 ...

  9. SQL Server 2014忘记SA密码或禁用而且Windows身份验证也无法登录的解决办法

    SQL Server双重验证都无法验证的情况下如何处理 1.以管理员身份运行sql配置管理器 2.打开[Sql Server 服务]节点关掉所有服务 3.双击本地实例[SQL Server (MSSQ ...

  10. android 注入so

    https://www.52pojie.cn/thread-564459-1-1.html