Commit d16e904e by Billy Larru

agregando jsp de pruebas de combinacion de filas

parent 4ae2bd33
<!DOCTYPE html>
<html>
<head>
<style>
body {
font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
color: #333;
background-color: #fff;
}
div.container {
min-width: 980px;
margin: 0 auto;
}
</style>
<!--<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>-->
<link href="//datatables.net/download/build/nightly/jquery.dataTables.css" rel="stylesheet" type="text/css" />
<meta charset=utf-8 />
<title>DataTables - JS Bin</title>
</head>
<body>
<div class="container">
<table id="example" class="display" width="100%">
<thead>
<th>Group</th>
<th>Second Group</th>
<th>Third group</th>
<th>forth</th>
<th>fith</th>
</thead>
</table>
</div>
<script type="text/javascript" src="../plantilla/assets/js/core/libraries/jquery.min.js"></script>
<!--<script src="//datatables.net/download/build/nightly/jquery.dataTables.js"></script>-->
<script src="../plantilla/assets/js/plugins/tables/datatables/datatables.min.js" type="text/javascript"></script>
<!--<script src="https://raw.githubusercontent.com/ashl1/datatables-rowsgroup/master/dataTables.rowsGroup.js"></script>-->
<script src="../js/lib/dataTables.rowsGroup.js" type="text/javascript"></script>
<script src="../js/lib/lodash.js" type="text/javascript"></script>
<script>
$(document).ready(function () {
let data = [];
data.push({"codigo": 1, "sg": "subgroupN", "g": "Group1", "ssg": 'sub-subgroupN', "e": 'ElementN', "e2": '2Element N'});
data.push({"codigo": 2, "sg": "subgroup1", "g": "Group2", "ssg": 'sub-subgroup1', "e": 'Element1', "e2": '2Element 1'});
data.push({"codigo": 3, "sg": "subgroup2", "g": "Group2", "ssg": 'sub-subgroup1', "e": 'Element1', "e2": '2Element 1'});
data.push({"codigo": 4, "sg": "subgroup2", "g": "Group2", "ssg": 'sub-subgroup1', "e": 'Element2', "e2": '2Element 2'});
data.push({"codigo": 5, "sg": "subgroup2", "g": "Group2", "ssg": 'sub-subgroup2', "e": 'Element3', "e2": '2Element 2'});
data.push({"codigo": 6, "sg": "subgroup2", "g": "Group2", "ssg": 'sub-subgroup2', "e": 'Element4', "e2": '2Element 4'});
data.push({"codigo": 7, "sg": "subgroup2", "g": "Group2", "ssg": 'sub-subgroup2', "e": 'Element2', "e2": '2Element 2'});
data.push({"codigo": 8, "sg": "subgroup3", "g": "Group1", "ssg": 'sub-subgroup1', "e": 'Element1', "e2": '2Element 1'});
data.push({"codigo": 9, "sg": "subgroup3", "g": "Group1", "ssg": 'sub-subgroup1', "e": 'Element1', "e2": '2Element 1'});
data.push({"codigo": 10, "sg": "subgroup2", "g": "Group2", "ssg": 'sub-subgroup2', "e": 'Element1', "e2": '2Element 1'});
data.push({"codigo": 11, "sg": "subgroup4", "g": "Group2", "ssg": 'sub-subgroup2', "e": 'Element1', "e2": '2Element 1'});
data.push({"codigo": 12, "sg": "subgroup4", "g": "Group2", "ssg": 'sub-subgroup3', "e": 'Element10', "e2": '2Element 17'});
data.push({"codigo": 13, "sg": "subgroup4", "g": "Group2", "ssg": 'sub-subgroup3', "e": 'Element231', "e2": '2Element 211'});
//
// var data = {
// [1, 'subgroupN', 'Group1', 'sub-subgroupN', 'ElementN', '2Element N' ],
// [2, 'subgroup1', 'Group2', 'sub-subgroup1', 'Element1', '2Element 1' ],
// [3, 'subgroup2', 'Group2', 'sub-subgroup1', 'Element1', '2Element 1' ],
// [4, 'subgroup2', 'Group2', 'sub-subgroup1', 'Element2', '2Element 2' ],
// [5, 'subgroup2', 'Group2', 'sub-subgroup2', 'Element3', '2Element 2' ],
// [6, 'subgroup2', 'Group2', 'sub-subgroup2', 'Element4', '2Element 4' ],
// [7, 'subgroup2', 'Group2', 'sub-subgroup2', 'Element2', '2Element 2' ],
// [8, 'subgroup3', 'Group1', 'sub-subgroup1', 'Element1', '2Element 1' ],
// [9, 'subgroup3', 'Group1', 'sub-subgroup1', 'Element1', '2Element 1' ],
// [10, 'subgroup2', 'Group2', 'sub-subgroup2','Element1', '2Element 1' ],
// [11, 'subgroup4', 'Group2', 'sub-subgroup2','Element1', '2Element 1' ],
// [12, 'subgroup4', 'Group2', 'sub-subgroup3','Element10', '2Element 17' ],
// [13, 'subgroup4', 'Group2', 'sub-subgroup3','Element231', '2Element 211' ],
// };
var table = $('#example').DataTable({
columns: [
{"data": "sg"},
{"data": "g"},
{"data": "ssg"},
{"data": "e"},
{"data": "e2"},
],
data: data,
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)
1,
0,
2
],
pageLength: '20',
});
// var table = $('#example').DataTable({
// columns: [
// {
// title: 'First group',
// },
// {
// name: 'second',
// title: 'Second group [order first]',
// },
// {
// title: 'Third group',
// },
// {
// title: 'Forth ungrouped',
// },
// {
// title: 'Fifth ungrouped',
// },
// ],
// data: data,
// 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)
// 'second:name',
// 0,
// 2
// ],
// pageLength: '20',
// });
});
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment