Skip to content

Commit dedad0b

Browse files
committed
init
0 parents  commit dedad0b

File tree

144 files changed

+52274
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+52274
-0
lines changed

MIT-LICENSE.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2010 Michael Leibman, http://github.com/mleibman/slickgrid
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## This is the 6pac slickgrid repo
2+
3+
I am maintaining this branch as a separate 'alternative master'. Check [my wiki](https://github.com/6pac/SlickGrid/wiki) for details.
4+
5+
Original mleibman README follows:
6+
7+
--------------------------------------------------------------------------------------------------------------------
8+
9+
Find documentation and examples in [the wiki](https://github.com/mleibman/SlickGrid/wiki).
10+
11+
# Welcome to SlickGrid
12+
13+
## SlickGrid is an advanced JavaScript grid/spreadsheet component
14+
15+
Some highlights:
16+
17+
* Adaptive virtual scrolling (handle hundreds of thousands of rows with extreme responsiveness)
18+
* Extremely fast rendering speed
19+
* Supports jQuery UI Themes
20+
* Background post-rendering for richer cells
21+
* Configurable & customizable
22+
* Full keyboard navigation
23+
* Column resize/reorder/show/hide
24+
* Column autosizing & force-fit
25+
* Pluggable cell formatters & editors
26+
* Support for editing and creating new rows.
27+
* Grouping, filtering, custom aggregators, and more!
28+
* Advanced detached & multi-field editors with undo/redo support.
29+
* “GlobalEditorLock” to manage concurrent edits in cases where multiple Views on a page can edit the same data.
30+
* Support for [millions of rows](http://stackoverflow.com/a/2569488/1269037)

bower.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "SlickGrid",
3+
"version": "2.2.4",
4+
"homepage": "https://github.com/gbelmm/SlickGrid",
5+
"authors": [
6+
"gbelmm <[email protected]>"
7+
],
8+
"license": "MIT",
9+
"ignore": [
10+
"**/.*",
11+
"node_modules",
12+
"bower_components",
13+
"test",
14+
"tests"
15+
]
16+
}

controls/slick.columnpicker.css

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.slick-columnpicker {
2+
border: 1px solid #718BB7;
3+
background: #f0f0f0;
4+
padding: 6px;
5+
-moz-box-shadow: 2px 2px 2px silver;
6+
-webkit-box-shadow: 2px 2px 2px silver;
7+
box-shadow: 2px 2px 2px silver;
8+
min-width: 100px;
9+
cursor: default;
10+
}
11+
12+
.slick-columnpicker li {
13+
list-style: none;
14+
margin: 0;
15+
padding: 0;
16+
background: none;
17+
}
18+
19+
.slick-columnpicker input {
20+
margin: 4px;
21+
}
22+
23+
.slick-columnpicker li a {
24+
display: block;
25+
padding: 4px;
26+
font-weight: bold;
27+
}
28+
29+
.slick-columnpicker li a:hover {
30+
background: white;
31+
}

controls/slick.columnpicker.js

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
(function ($) {
2+
function SlickColumnPicker(columns, grid, options) {
3+
var $menu;
4+
var columnCheckboxes;
5+
6+
var defaults = {
7+
fadeSpeed:250
8+
};
9+
10+
function init() {
11+
grid.onHeaderContextMenu.subscribe(handleHeaderContextMenu);
12+
grid.onColumnsReordered.subscribe(updateColumnOrder);
13+
options = $.extend({}, defaults, options);
14+
15+
$menu = $("<span class='slick-columnpicker' style='display:none;position:absolute;z-index:20;' />").appendTo(document.body);
16+
17+
$menu.bind("mouseleave", function (e) {
18+
$(this).fadeOut(options.fadeSpeed)
19+
});
20+
$menu.bind("click", updateColumn);
21+
22+
}
23+
24+
function destroy() {
25+
grid.onHeaderContextMenu.unsubscribe(handleHeaderContextMenu);
26+
grid.onColumnsReordered.unsubscribe(updateColumnOrder);
27+
$menu.remove();
28+
}
29+
30+
function handleHeaderContextMenu(e, args) {
31+
e.preventDefault();
32+
$menu.empty();
33+
updateColumnOrder();
34+
columnCheckboxes = [];
35+
36+
var $li, $input;
37+
for (var i = 0; i < columns.length; i++) {
38+
$li = $("<li />").appendTo($menu);
39+
$input = $("<input type='checkbox' />").data("column-id", columns[i].id);
40+
columnCheckboxes.push($input);
41+
42+
if (grid.getColumnIndex(columns[i].id) != null) {
43+
$input.attr("checked", "checked");
44+
}
45+
46+
$("<label />")
47+
.text(columns[i].name)
48+
.prepend($input)
49+
.appendTo($li);
50+
}
51+
52+
$("<hr/>").appendTo($menu);
53+
$li = $("<li />").appendTo($menu);
54+
$input = $("<input type='checkbox' />").data("option", "autoresize");
55+
$("<label />")
56+
.text("Force fit columns")
57+
.prepend($input)
58+
.appendTo($li);
59+
if (grid.getOptions().forceFitColumns) {
60+
$input.attr("checked", "checked");
61+
}
62+
63+
$li = $("<li />").appendTo($menu);
64+
$input = $("<input type='checkbox' />").data("option", "syncresize");
65+
$("<label />")
66+
.text("Synchronous resize")
67+
.prepend($input)
68+
.appendTo($li);
69+
if (grid.getOptions().syncColumnCellResize) {
70+
$input.attr("checked", "checked");
71+
}
72+
73+
$menu
74+
.css("top", e.pageY - 10)
75+
.css("left", e.pageX - 10)
76+
.fadeIn(options.fadeSpeed);
77+
}
78+
79+
function updateColumnOrder() {
80+
// Because columns can be reordered, we have to update the `columns`
81+
// to reflect the new order, however we can't just take `grid.getColumns()`,
82+
// as it does not include columns currently hidden by the picker.
83+
// We create a new `columns` structure by leaving currently-hidden
84+
// columns in their original ordinal position and interleaving the results
85+
// of the current column sort.
86+
var current = grid.getColumns().slice(0);
87+
var ordered = new Array(columns.length);
88+
for (var i = 0; i < ordered.length; i++) {
89+
if ( grid.getColumnIndex(columns[i].id) === undefined ) {
90+
// If the column doesn't return a value from getColumnIndex,
91+
// it is hidden. Leave it in this position.
92+
ordered[i] = columns[i];
93+
} else {
94+
// Otherwise, grab the next visible column.
95+
ordered[i] = current.shift();
96+
}
97+
}
98+
columns = ordered;
99+
}
100+
101+
function updateColumn(e) {
102+
if ($(e.target).data("option") == "autoresize") {
103+
if (e.target.checked) {
104+
grid.setOptions({forceFitColumns:true});
105+
grid.autosizeColumns();
106+
} else {
107+
grid.setOptions({forceFitColumns:false});
108+
}
109+
return;
110+
}
111+
112+
if ($(e.target).data("option") == "syncresize") {
113+
if (e.target.checked) {
114+
grid.setOptions({syncColumnCellResize:true});
115+
} else {
116+
grid.setOptions({syncColumnCellResize:false});
117+
}
118+
return;
119+
}
120+
121+
if ($(e.target).is(":checkbox")) {
122+
var visibleColumns = [];
123+
$.each(columnCheckboxes, function (i, e) {
124+
if ($(this).is(":checked")) {
125+
visibleColumns.push(columns[i]);
126+
}
127+
});
128+
129+
if (!visibleColumns.length) {
130+
$(e.target).attr("checked", "checked");
131+
return;
132+
}
133+
134+
grid.setColumns(visibleColumns);
135+
}
136+
}
137+
138+
function getAllColumns() {
139+
return columns;
140+
}
141+
142+
init();
143+
144+
return {
145+
"getAllColumns": getAllColumns,
146+
"destroy": destroy
147+
};
148+
}
149+
150+
// Slick.Controls.ColumnPicker
151+
$.extend(true, window, { Slick:{ Controls:{ ColumnPicker:SlickColumnPicker }}});
152+
})(jQuery);

controls/slick.pager.css

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.slick-pager {
2+
width: 100%;
3+
height: 26px;
4+
border: 1px solid gray;
5+
border-top: 0;
6+
background: url('../images/header-columns-bg.gif') repeat-x center bottom;
7+
vertical-align: middle;
8+
}
9+
10+
.slick-pager .slick-pager-status {
11+
display: inline-block;
12+
padding: 6px;
13+
}
14+
15+
.slick-pager .ui-icon-container {
16+
display: inline-block;
17+
margin: 2px;
18+
border-color: gray;
19+
}
20+
21+
.slick-pager .slick-pager-nav {
22+
display: inline-block;
23+
float: left;
24+
padding: 2px;
25+
}
26+
27+
.slick-pager .slick-pager-settings {
28+
display: block;
29+
float: right;
30+
padding: 2px;
31+
}
32+
33+
.slick-pager .slick-pager-settings * {
34+
vertical-align: middle;
35+
}
36+
37+
.slick-pager .slick-pager-settings a {
38+
padding: 2px;
39+
text-decoration: underline;
40+
cursor: pointer;
41+
}

0 commit comments

Comments
 (0)