easyui中datagrid用法,加载table数据与标题
加载标题写法:
多行标题:columns: [[
columns: [[
{ field: 'itemid', title: 'Item ID', rowspan: 2, width: 80, sortable: true },
{ field: 'productid', title: 'Product ID', rowspan: 2, width: 80, sortable: true },
{ title: 'Item Details', colspan: 4 }
], [
{ field: 'listprice', title: 'List Price', width: 80, align: 'right', sortable: true },
{ field: 'unitcost', title: 'Unit Cost', width: 80, align: 'right', sortable: true },
{ field: 'attr1', title: 'Attribute', width: 100 },
{ field: 'status', title: 'Status', width: 60 }
]]
单行标题用Js实现:
$('#tt').datagrid({
columns: [[
{ field: 'itemid', title: 'Item ID', width: 80 },
{ field: 'productid', title: 'Product ID', width: 80 },
{ field: 'listprice', title: 'List Price', width: 80, align: 'right' },
{ field: 'unitcost', title: 'Unit Cost', width: 80, align: 'right' },
{ field: 'attr1', title: 'Attribute', width: 100 },
{ field: 'status', title: 'Status', width: 60 }
]]
});
实现一个table的数据加载例子:
静态:
var data_ = [{
"dataindex0": "1",
"dataindex1": "Y08",
"dataindex2": "Y00000000158",
"dataindex3": "注",
"dataindex4": "Z",
"dataindex5": "注",
"dataindex6": "250",
"dataindex7": "东北厂",
"dataindex8": "国",
"dataindex9": "123123",
"dataindex10": null,
"dataindex11": null,
"dataindex12": null,
"dataindex13": null
},
{
"dataindex0": "1",
"dataindex1": "Y08",
"dataindex2": "Y00000000158",
"dataindex3": "注",
"dataindex4": "Z",
"dataindex5": "注",
"dataindex6": "250",
"dataindex7": "东北厂",
"dataindex8": "国",
"dataindex9": "123123",
"dataindex10": null,
"dataindex11": null,
"dataindex12": null,
"dataindex13": null
}];
方法一:
$('#dg').datagrid({
fit: true,
checkOnSelect: true,
selectOnCheck: true,
singleSelect: true,
fitColumns: true,
data:data_,
//pageSize:100,
//pagination:true,
columns: [[
{ field: 'dataindex0', title: 'dataindex0', width: 80 },
{ field: 'dataindex1', title: 'dataindex1', width: 80 },
{ field: 'dataindex2', title: 'dataindex2', width: 80 },
{ field: 'dataindex3', title: 'dataindex3', width: 80 },
{ field: 'dataindex4', title: 'dataindex4', width: 80 },
{ field: 'dataindex5', title: 'dataindex5', width: 80 },
{ field: 'dataindex6', title: 'dataindex6', width: 80 },
{ field: 'dataindex7', title: 'dataindex7', width: 80 },
{ field: 'dataindex8', title: 'dataindex8', width: 80 },
{ field: 'dataindex9', title: 'dataindex9', width: 80 }
]]
});
方法二:
$('#dg').datagrid({
fit: true,
checkOnSelect: true,
selectOnCheck: true,
singleSelect: true,
fitColumns: true,
//pageSize:100,
//pagination:true,
columns: [[
{ field: 'dataindex1', title: 'dataindex1', width: 80 },
{ field: 'dataindex2', title: 'dataindex2', width: 80 },
{ field: 'dataindex3', title: 'dataindex3', width: 80 },
{ field: 'dataindex4', title: 'dataindex4', width: 80 },
{ field: 'dataindex5', title: 'dataindex5', width: 80 },
{ field: 'dataindex6', title: 'dataindex6', width: 80 },
{ field: 'dataindex7', title: 'dataindex7', width: 80 },
{ field: 'dataindex8', title: 'dataindex8', width: 80 },
{ field: 'dataindex9', title: 'dataindex9', width: 80 },
{ field: 'dataindex10', title: 'dataindex10', width: 80 }
]]
});
easyui中datagrid用法,加载table数据与标题的更多相关文章
- WPF DataGrid 性能加载大数据
WPF(Windows Presentation Foundation)应用程序在没有图形加速设备的机器上运行速度很慢是个公开的秘密,给用户的感觉是它太吃资源了,WPF程序的性能和硬件确实有很大的关系 ...
- Ajax在jQuery中的应用---加载异步数据
Ajax是Asynchronous JavaScript and XML的缩写,其核心是通过XMLHttpRequest对象,以一种异步的方式,向服务器发送数据请求,并通过该对象接收请求返回的数据,从 ...
- 【转载】WPF DataGrid 性能加载大数据
作者:过客非归 来源:CSDN 原文:https://blog.csdn.net/u010265681/article/details/76651725 WPF(Windows Presentatio ...
- EasyUI datagrid动态加载json数据
最近做一个项目,要求是两张张表可能查找出10多种不同的结果集. 如果想只用一个表格就把全部的结果不同的显示出来那么就肯定不同使用固定的字段名字,要通过动态加载后台返回来的数据把它显示出来就必须动态加载 ...
- EasyUI中, datagrid用loadData方法绑定数据。
$("#dg").datagrid("loadData", { , " }, { "ck": "1", &qu ...
- layui中,同一个页面动态加载table数据表格
效果图: 前端代码: <div class="layui-fluid" id="record-user" hidden="hidden" ...
- easyui datagrid 异步加载数据时滚动条有时会自动滚到最底部的问题
在使用easyui 的datagrid异步加载数据时发现滚动条有时会自动滚到最底部.经测试发现,如果加载数据前没有选中行则不会出现这个问题.这样我们可以在重新异步加载数据前取消选中行就可以避免这个问题 ...
- easyui datagrid 动态加载数据 渲染问题,表格错位问题
$('#dg').datagrid({ url:'datagrid_data.json', columns:[[ {field:'code',title:'Code',width:100}, {fie ...
- jquery easyui easyui-treegrid 使用异步加载数据
jquery easyui easyui-treegrid 使用异步加载数据 jquery easyui easyui-treegrid 异步请求 >>>>>>&g ...
随机推荐
- pthread到Win32thread
一.什么是线程. 线程(thread)是为了提高系统内程序的并发(concurrency)执行程度而提出来的概念,它是比进程更小的能够独立运行的基本单位.在引入线程的系统中,线程是处理器调度(sche ...
- 【js】js中的||和&&
逻辑与&&和逻辑或||操作符可以应用于任何类型的操作数,而不仅仅是布尔值. 几乎所有语言中||和&&都遵循“短路”原理, 如&&中第一个表达式为假就不会 ...
- pythonl练习笔记——threading创建进程锁Lock()
1 基本概述 采用threading.Lock()对象创建锁lock,即 lock = threading.Lock() 其相关方法主要有 lock.acquire() # lock the lock ...
- C#--索引
索引是一组get和set访问器,类似于属性的访问器. 索引和属性在很多方面是相似的. 和属性一样,索引不用分配内存来存储: 索引和属性都主要被用来访问其他数据成员,这些成员和他们关联,他们为这些成员提 ...
- EMC测试
EMC主要包括EMI和EMS
- Spring MVC 的xml一些配置
1.可以自动加载注解驱动,通过注解找到对应Controller <!-- spring MVC 注解驱动 --> <mvc:annotation-driven></mvc ...
- Spring mvc中DispatcherServlet详解
简介 DispatcherServlet是前端控制器设计模式的实现,提供SpringWebMVC的集中访问点,而且负责职责的分派,而且与spring IOC容器无缝集成,从而可以获得Spring的优势 ...
- Spring cloud子项目
目前来说spring主要集中于spring boot(用于开发微服务)和spring cloud相关框架的开发,我们从几张图着手理解,然后再具体介绍: spring cloud子项目包括: Sprin ...
- Java:集合,对列表(List)中的数据(整型、字符串、日期等)进行排序(正序、倒序)的方法;字符串按照整型排序的方法
1. 要求 对List列表中的数据进行排序(正序.倒序),列表中的数据包括:整型(Integer).字符串(String).日期(Date)等.对于字符串,要求允许对它按照整型进行排序. 2. 实现思 ...
- jdbc连接hive0.14
Jdbc连接hive0.14版本号 眼下官网最新版本号是hive0.13,要想下载最新的hive得去git上去clone一个. Hive0.14最大特点是支持直接插入. 如今做一个jdbc连接hive ...