datables

https://editor.datatables.net/examples/styling/bootstrap.html

https://datatables.net/forums/discussion/29319/new-rowsgroup-plugin-merge-cells-vertically-rowspan

https://github.com/ashl1/datatables-rowsgroup/blob/master/example.html

<html>
<head>
<link rel="stylesheet" href="http://cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css">

<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="http://cdn.datatables.net/1.10.7/js/jquery.dataTables.js"></script>
<script src="dataTables.rowsGroup.js"></script>
</head>
<body>
<button id="update_btn">Manual remerge cells</button>
<table id="example"></table>
<table id="example1"></table>
<script>
$(function(){
var data = [
[‘subgroupN‘, ‘Group1‘, ‘sub-subgroupN‘, ‘ElementN‘, ‘2Element N‘],
[‘subgroup1‘, ‘Group2‘, ‘sub-subgroup1‘, ‘Element1‘, ‘2Element 1‘],
[‘subgroup2‘, ‘Group2‘, ‘sub-subgroup1‘, ‘Element1‘, ‘2Element 1‘],
[‘subgroup2‘, ‘Group2‘, ‘sub-subgroup1‘, ‘Element2‘, ‘2Element 2‘],
[‘subgroup2‘, ‘Group2‘, ‘sub-subgroup2‘, ‘Element3‘, ‘2Element 2‘],
[‘subgroup2‘, ‘Group2‘, ‘sub-subgroup2‘, ‘Element4‘, ‘2Element 4‘],
[‘subgroup2‘, ‘Group2‘, ‘sub-subgroup2‘, ‘Element2‘, ‘2Element 2‘],
[‘subgroup3‘, ‘Group1‘, ‘sub-subgroup1‘, ‘Element1‘, ‘2Element 1‘],
[‘subgroup3‘, ‘Group1‘, ‘sub-subgroup1‘, ‘Element1‘, ‘2Element 1‘],
[‘subgroup2‘, ‘Group2‘, ‘sub-subgroup2‘, ‘Element1‘, ‘2Element 1‘],
[‘subgroup4‘, ‘Group2‘, ‘sub-subgroup2‘, ‘Element1‘, ‘2Element 1‘],
[‘subgroup4‘, ‘Group2‘, ‘sub-subgroup3‘, ‘Element10‘, ‘2Element 17‘],
[‘subgroup4‘, ‘Group2‘, ‘sub-subgroup3‘, ‘Element231‘, ‘2Element 211‘],

]
var table = $(‘#example‘).DataTable({
"iDisplayLength" : 8,
columns: [
{
title: ‘First group‘,
},
{
name: ‘second‘,
title: ‘Second group [order first]‘,
},
{
title: ‘Third group‘,
},
{
title: ‘Forth ungrouped‘,
},
{
title: ‘Fifth ungrouped‘,
},
],
data: data,
/*lengthChange: false,
searching: true,
paging: true,
order: [],*/
rowsGroup: [// Always the array (!) of the column-selectors in specified order to which rows groupping is applied
// (column-selector could be any of specified in https://datatables.net/reference/type/column-selector)
0
],
})
/*table.draw(false);
$(‘#update_btn‘).click(function(){
table.rowsgroup.update();
})*/

var table1 = $(‘#example1‘).DataTable({
"iDisplayLength" : 8,
columns: [
{
title: ‘First group‘,
},
{
name: ‘second‘,
title: ‘Second group [order first]‘,
},
{
title: ‘Third group‘,
},
{
title: ‘Forth ungrouped‘,
},
{
title: ‘Fifth ungrouped‘,
},
],
data: data,
/*lengthChange: false,
searching: true,
paging: true,
order: [],*/
rowsGroup: [// Always the array (!) of the column-selectors in specified order to which rows groupping is applied
// (column-selector could be any of specified in https://datatables.net/reference/type/column-selector)
0
],
})
/*table1.draw(false);*/
/*$(‘#update_btn‘).click(function(){
table.rowsgroup.update();
})*/

});
</script>
</body>
</html>

时间: 2024-10-22 22:06:03

datables的相关文章

Datables wrning(table id=&#39;example&#39;):Cannot reinitialise DataTable.

出现的问题如下所示: 1 Datables wrning(table id='example'):Cannot reinitialise DataTable. To retrieve the 2 Datables object for this table,please pass eithser no arguments to the dataTable() function, 我查阅了网上的教程. 给出两种解决方式: 加 "bDestroy":true,和"bRetriev

【干货】Jquery.Datables与Bootstrap3的组合使用

官方地址 datatables官方网址:www.datatables.net 下载bootstrap3与datables文件包 引用文件 css:bootstrap.css.dataTables.bootstrap.css js:jquery.js.jquery.dataTables.js.dataTables.bootstrap.js 不说废话,上干货 demo的实现 1.新建MVC空项目 2.在Models文件夹下新建Person.cs模型类 Person.cs代码: public clas

datables的基本操作

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><!-- views/component/commomOpinion/opinionList.jsp --><%@include file="/WEB-INF/views/commons/common.jsp"%><

Datables 服务端分页for DJango

安装 django-datatables-view pip install django-datatables-view 前端配置-JS部分 $('#mytable').DataTable({ "paging": true, "lengthChange": true, "searching": true, "ordering": true, "info": true, "autoWidth&quo

jquery datables ajax分页后的点击事件无效是怎么回事

异步请求数据后,动态向table中追加行,行点击事件失效 动态加入到DOM中的对象无法继承原有的事件,所以无效,举例: // $.ajax... ajax部分省略 var tr = ""; if(data.length){     for(var i=0; i<data.length; i++){         tr = '<tr>';         tr += '<td>' + data.status == 0 ? "正常" : 

linux c编程访问数据库

源码如下: #include <stdio.h> #include <stdlib.h> #include <mysql/mysql.h> int main() { /*定义mysql变量*/ MYSQL *coon; //数据库链接时使用的句柄 MYSQL_RES *res; //返回行的查询结果 MYSQL_ROW row; //记录集中的一条数据 char server[] = "192.168.1.105"; char user[] = &q

Controller和View的交互

Controller和View的交互 目录 ASP.NET MVC搭建项目后台UI框架—1.后台主框架 ASP.NET MVC搭建项目后台UI框架—2.菜单特效 ASP.NET MVC搭建项目后台UI框架—3.面板折叠和展开 ASP.NET MVC搭建项目后台UI框架—4.tab多页签支持 ASP.NET MVC搭建项目后台UI框架—5.Demo演示Controller和View的交互 这一节,我将用一个Demo来演示在此UI框架中,控制器和视图的交互.以渠道管理为例.效果图如下: 这里我使用了

ASP.NET MVC搭建项目后台UI框架—9、服务器端排序

ASP.NET MVC搭建项目后台UI框架—1.后台主框架 ASP.NET MVC搭建项目后台UI框架—2.菜单特效 ASP.NET MVC搭建项目后台UI框架—3.面板折叠和展开 ASP.NET MVC搭建项目后台UI框架—4.tab多页签支持 ASP.NET MVC搭建项目后台UI框架—5.Demo演示Controller和View的交互 ASP.NET MVC搭建项目后台UI框架—6.客户管理(添加.修改.查询.分页) ASP.NET MVC搭建项目后台UI框架—7.统计报表 ASP.NE

JQuery中DataTables强大的表格解决方案

(1)DataTables的默认配置 $(function(){ $("#workbench_topicTable").dataTable(); }) (2)DataTables的基础配置 $("#workbench_topicTable").DataTable({ bPaginate: true, //翻页功能 bLengthChange: true, //改变每页显示数据数量 bFilter: true, //过滤功能 bSort: false, //排序功能