Skip to content

Commit c2a271b

Browse files
committed
release v2.4.14 - update github.io
1 parent bfc8b74 commit c2a271b

File tree

9 files changed

+1787
-30
lines changed

9 files changed

+1787
-30
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5+
<link rel="shortcut icon" type="image/ico" href="favicon.ico" />
6+
<link rel="stylesheet" href="../css/smoothness/jquery-ui-1.11.3.custom.css" type="text/css"/>
7+
<link rel="stylesheet" href="../slick.grid.css" type="text/css"/>
8+
<link rel="stylesheet" href="examples.css" type="text/css"/>
9+
<style>
10+
.slick-preheader-panel.ui-state-default {
11+
width: 100%;
12+
overflow: hidden;
13+
border-left: 0px !important;
14+
border-bottom: 0px !important;
15+
}
16+
.slick-preheader-panel .slick-header-columns {
17+
border-bottom: 0px !important;
18+
}
19+
</style>
20+
</head>
21+
<body>
22+
<div style="position:relative">
23+
<div style="width:600px;">
24+
<div id="myGrid" style="width:100%;height:500px;"></div>
25+
</div>
26+
27+
<div class="options-panel">
28+
<h2>Demonstrates:</h2>
29+
<ul>
30+
<li>Frozen columns with extra header row grouping columns into categories</li>
31+
</ul>
32+
<h2>View Source:</h2>
33+
<ul>
34+
<li><A href="https://github.com/6pac/SlickGrid/blob/master/examples/example-frozen-columns-and-column-group.html" target="_sourcewindow"> View the source for this example on Github</a></li>
35+
</ul>
36+
</div>
37+
</div>
38+
39+
<script src="../lib/firebugx.js"></script>
40+
41+
<script src="../lib/jquery-1.11.2.min.js"></script>
42+
<script src="../lib/jquery-ui-1.11.3.min.js"></script>
43+
<script src="../lib/jquery.event.drag-2.3.0.js"></script>
44+
45+
<script src="../slick.core.js"></script>
46+
<script src="../slick.dataview.js"></script>
47+
<script src="../slick.grid.js"></script>
48+
49+
<script>
50+
function CreateAddlHeaderRow() {
51+
// Add column groups to left panel
52+
var $preHeaderPanel = $(grid.getPreHeaderPanelLeft());
53+
renderHeaderGroups($preHeaderPanel, 0, options.frozenColumn + 1);
54+
55+
// Add column groups to right panel
56+
$preHeaderPanel = $(grid.getPreHeaderPanelRight());
57+
renderHeaderGroups($preHeaderPanel, options.frozenColumn + 1, columns.length);
58+
59+
function renderHeaderGroups(preHeaderPanel, start, end) {
60+
preHeaderPanel.empty()
61+
.addClass("slick-header-columns")
62+
.css('left','-1000px')
63+
.width(grid.getHeadersWidth());
64+
preHeaderPanel.parent().addClass("slick-header");
65+
66+
var headerColumnWidthDiff = grid.getHeaderColumnWidthDiff();
67+
var m, header, lastColumnGroup = '', widthTotal = 0;
68+
69+
for (var i = start; i < end; i++) {
70+
m = columns[i];
71+
if (lastColumnGroup === m.columnGroup && i>start) {
72+
widthTotal += m.width;
73+
header.width(widthTotal - headerColumnWidthDiff)
74+
} else {
75+
widthTotal = m.width;
76+
header = $("<div class='ui-state-default slick-header-column' />")
77+
.html("<span class='slick-column-name'>" + (m.columnGroup || '') + "</span>")
78+
.width(m.width - headerColumnWidthDiff)
79+
.appendTo(preHeaderPanel);
80+
}
81+
lastColumnGroup = m.columnGroup;
82+
}
83+
}
84+
}
85+
86+
var dataView;
87+
var grid;
88+
var data = [];
89+
var options = {
90+
enableCellNavigation: true,
91+
enableColumnReorder: false,
92+
createPreHeaderPanel: true,
93+
showPreHeaderPanel: true,
94+
preHeaderPanelHeight: 23,
95+
explicitInitialization: true,
96+
frozenColumn: 2
97+
};
98+
var columns = [
99+
{id: "sel", name: "#", field: "num", behavior: "select", cssClass: "cell-selection", width: 40, resizable: false, selectable: false },
100+
{id: "title", name: "Title", field: "title", width: 120, minWidth: 120, cssClass: "cell-title", columnGroup:"Common Factor"},
101+
{id: "duration", name: "Duration", field: "duration", columnGroup:"Common Factor"},
102+
{id: "start", name: "Start", field: "start", minWidth: 140, columnGroup:"Period"},
103+
{id: "finish", name: "Finish", field: "finish", minWidth: 140, columnGroup:"Period"},
104+
{id: "%", defaultSortAsc: false, name: "% Complete", field: "percentComplete", width: 140, resizable: false, columnGroup:"Analysis"},
105+
{id: "effort-driven", name: "Effort Driven", width: 140, minWidth: 20, maxWidth: 140, field: "effortDriven", columnGroup:"Analysis"}
106+
];
107+
108+
$(function () {
109+
for (var i = 0; i < 50000; i++) {
110+
var d = (data[i] = {});
111+
112+
d["id"] = "id_" + i;
113+
d["num"] = i;
114+
d["title"] = "Task " + i;
115+
d["duration"] = "5 days";
116+
d["start"] = "01/01/2009";
117+
d["finish"] = "01/05/2009";
118+
d["percentComplete"] = Math.round(Math.random() * 100);
119+
d["effortDriven"] = (i % 5 == 0);
120+
}
121+
122+
dataView = new Slick.Data.DataView();
123+
grid = new Slick.Grid("#myGrid", dataView, columns, options);
124+
125+
dataView.onRowCountChanged.subscribe(function (e, args) {
126+
grid.updateRowCount();
127+
grid.render();
128+
});
129+
130+
dataView.onRowsChanged.subscribe(function (e, args) {
131+
grid.invalidateRows(args.rows);
132+
grid.render();
133+
});
134+
135+
grid.init();
136+
137+
grid.onColumnsResized.subscribe(function (e, args) {
138+
CreateAddlHeaderRow();
139+
});
140+
141+
// Initialise data
142+
dataView.beginUpdate();
143+
dataView.setItems(data);
144+
dataView.endUpdate();
145+
146+
CreateAddlHeaderRow();
147+
})
148+
</script>
149+
</body>
150+
</html>

SlickGrid/examples/example16-row-detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ <h2>View Source:</h2>
254254

255255
if (item[column.field] !== undefined) {
256256
var filterResult = typeof item[column.field].indexOf === 'function'
257-
? (item[column.field].indexOf(columnFilters[columnId] && columnFilters[columnId]) === -1)
257+
? (item[column.field].indexOf(columnFilters[columnId]) === -1)
258258
: (item[column.field] != columnFilters[columnId]);
259259

260260
if (filterResult) {

0 commit comments

Comments
 (0)