Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/frozen grid closes request #26 #311

Merged
merged 57 commits into from
Dec 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9d0ad63
feature(grid): first working draft of X-Slickgrid merge to SlickGrid
ghiscoding May 15, 2018
6ac4e4e
fixed couple of issues found and get code closer to previous code
ghiscoding May 15, 2018
6ef59c8
refactored code from original slick.grid file
ghiscoding May 17, 2018
41153bc
fix editor position and data
ghiscoding May 17, 2018
553d9c0
update to latest and copy more of the original code
ghiscoding May 19, 2018
e3d9856
fix pre-header
ghiscoding May 19, 2018
28805d9
few fixes mentioned in #26
ghiscoding Dec 1, 2018
2961557
update code as per comment in #26
ghiscoding Dec 1, 2018
51f38e5
refactored cellrange as per comment in issue #26
ghiscoding Dec 7, 2018
962073d
fix invalid error catch
ghiscoding Dec 12, 2018
77ffa9f
feature(selector): Provide a way to hide the "Select All" checkbox
ghiscoding May 19, 2018
5b5839c
refactor(selector): make sure the isSelectAllChecked is always available
ghiscoding May 19, 2018
7ea5375
feat(picker): Column Picker expose init to use by translation
ghiscoding Jun 20, 2018
3ffcf01
Use text=auto for JS and HTML files
ghiscoding Dec 20, 2018
6465048
Use text=auto for JS and HTML files
ghiscoding Dec 20, 2018
61d552d
add onAutosizeColumns event
ghiscoding Dec 20, 2018
9db83fa
remove e (causing error) from onResizeColumns
ghiscoding Dec 20, 2018
d747468
feat(demo): add demo for testing grid.autosizeColumns fn, ref #264
ghiscoding Jul 26, 2018
27cbbca
feat(checkbox): add way to show Checbox Selector in Filter Row
ghiscoding Sep 11, 2018
345e8d5
refactor(link): update view source link
ghiscoding Sep 11, 2018
56b0351
refactor(selector): fix incorrect checkbox for label
ghiscoding Sep 11, 2018
116d6d8
refactor(selector): fix toggle show/hide select all with Font-Awesom
ghiscoding Sep 11, 2018
3424357
refactor(selector): add toggle to change row to display Select All btn
ghiscoding Sep 11, 2018
2e65ced
fix Select All checked flag when using setOptions on filter row
ghiscoding Sep 11, 2018
b4f9943
fix handle click from title not always working when using setOptions
ghiscoding Sep 11, 2018
364b9e2
refactor(selector): inversed flag from showX to hideX
ghiscoding Sep 11, 2018
449077d
remove jqueryui dependency in groupmetadataprovider
ghiscoding Dec 20, 2018
8aa0d2c
fix setSelectedRows should bypass when editor is active, closes #278
ghiscoding Dec 20, 2018
c5dddb5
Feature/row detail view (#287)
ghiscoding Nov 20, 2018
c5b2bb0
Clean up .npmignore and exclude test/examples from final npm bundle (…
sehrope Nov 20, 2018
5a60f94
Fix hidden sort column when multiColumnSort = true
levushka Nov 27, 2018
d9ce5d8
update keycode constant to remove jQuery dependency
6pac Dec 4, 2018
0e300b6
add css patch line for firefox
ghiscoding Dec 20, 2018
2639fdd
fix gotoRowStart and gotoRowEnd bug as per issue #279
ghiscoding Dec 20, 2018
2f0ae1a
Add event to editor initialisation code as per #276. Add column name
ghiscoding Dec 20, 2018
94abb84
fix missing e param in makeActiveCellEditable
ghiscoding Dec 20, 2018
48d7f67
fixes issue #299, notify onGroupChanged even on empty array
ghiscoding Dec 8, 2018
5de5182
fix grid variable not exist in setSelectedRows
ghiscoding Dec 20, 2018
43988e6
remove redundant notify since it should only be called in updateGroupBy
ghiscoding Dec 8, 2018
7807ef0
feat(grouping): add caller/originator to updateGroupBy
ghiscoding Dec 8, 2018
deaeb7e
WIP - row detail view - provide alternative calculation (#304)
ghiscoding Dec 14, 2018
443d68d
fix(gridmenu): should be using grid UID for menu independence (#305)
ghiscoding Dec 14, 2018
579799e
add new event: onRenderedEvent
ghiscoding Dec 20, 2018
bfb7052
row detail plugin, use new onRendered event (#310)
ghiscoding Dec 18, 2018
392a75a
Add option.alwaysShowHorizontalScroll to fix #307
ghiscoding Dec 20, 2018
f12fc16
Change option name to alwaysAllowHorizontalScroll as per #307
ghiscoding Dec 20, 2018
a157c05
enable trim white space on file save
ghiscoding Dec 20, 2018
09e1908
fix cell range selector with/without frozen columns
ghiscoding Dec 21, 2018
430d7b3
fix some grids with pane overflowing in some cases
ghiscoding Dec 21, 2018
77148e6
cleanup code remove x-slickgrid comments
ghiscoding Dec 22, 2018
ad6c25f
rollback slick-pane css position since it breaks other grids
ghiscoding Dec 22, 2018
4c77bbd
fix draggable grouping example pre-header toggler leave blank space
ghiscoding Dec 22, 2018
ca231fa
fixed frozen grid row with new row count not changing scroll vertical
ghiscoding Dec 22, 2018
bd06a39
resolve some conflicts
ghiscoding Dec 22, 2018
ef63287
put back previous example-select2-editor example to fix all chars
ghiscoding Dec 22, 2018
c0a8450
add favicon to all frozen grids
ghiscoding Dec 22, 2018
f723e15
add frozen class to header row when exist for styling purposes
ghiscoding Dec 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion controls/slick.columnpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
$list.empty();
updateColumnOrder();
columnCheckboxes = [];

var $li, $input;
var columnLabel;
for (var i = 0; i < columns.length; i++) {
Expand Down
9 changes: 8 additions & 1 deletion controls/slick.gridmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@

function SlickGridMenu(columns, grid, options) {
var _grid = grid;
var _gridOptions;
var _gridUid = (grid && grid.getUID) ? grid.getUID() : '';
var _isMenuOpen = false;
var _options = options;
Expand All @@ -113,8 +114,14 @@
};

function init(grid) {
_gridOptions = grid.getOptions();
var gridMenuWidth = (_options.gridMenu && _options.gridMenu.menuWidth) || _defaults.menuWidth;
var $header = $('.' + _gridUid + ' .slick-header');
var $header;
if (_gridOptions && _gridOptions.frozenColumn && _gridOptions.frozenColumn > 0 ) {
$header = $('.' + _gridUid + ' .slick-header-right');
} else {
$header = $('.' + _gridUid + ' .slick-header-left');
}
$header.attr('style', 'width: calc(100% - ' + gridMenuWidth +'px)');

// subscribe to the grid, when it's destroyed, we should also destroy the Grid Menu
Expand Down
6 changes: 3 additions & 3 deletions examples/example-draggable-grouping.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ <h2>View Source:</h2>
function toggleDraggableGrouping() {
clearGroupings();
if ( draggableEnabled == true ) {
$(".slick-preheader-panel").hide();
draggableEnabled = false;
grid.setPreHeaderPanelVisibility(false);
draggableEnabled = false;
} else {
$(".slick-preheader-panel").show();
grid.setPreHeaderPanelVisibility(true);
draggableEnabled = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/example-explicit-initialization.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h2>View Source:</h2>
}

// create a detached container element
var myGrid = $("<div id='myGrid' style='width:600px;height:500px;'></div>");
var myGrid = $("<div id='myGrid' style='width:600px;height:500px;position:relative;'></div>");
grid = new Slick.Grid(myGrid, data, columns, options);


Expand Down
174 changes: 174 additions & 0 deletions examples/example-frozen-columns-and-rows-spreadsheet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="shortcut icon" type="image/ico" href="favicon.ico" />
<title>SlickGrid Example: Spreadsheet with Frozen Rows and Columns</title>
<link rel="stylesheet" href="../slick.grid.css" type="text/css"/>
<link rel="stylesheet" href="../css/smoothness/jquery-ui-1.11.3.custom.css" type="text/css"/>
<link rel="stylesheet" href="examples.css" type="text/css"/>
<style>
.slick-cell.copied {
background: blue;
background: rgba(0, 0, 255, 0.2);
-webkit-transition: 0.5s background;
}
</style>
</head>
<body>
<div style="position:relative">
<div style="width:600px;">
<div id="myGrid" style="width:100%;height:500px;"></div>
</div>

<div class="options-panel">
<h2>Demonstrates:</h2>
<ul>
<li>Virtual scrolling on both rows and columns.</li>
<li>Select a range of cells with a mouse</li>
<li>Use Ctrl-C and Ctrl-V keyboard shortcuts to cut and paste cells</li>
<li>Use Esc to cancel a copy and paste operation</li>
<li>Edit the cell and select a cell range to paste the range</li>
</ul>
</div>
</div>

<script src="../lib/firebugx.js"></script>

<script src="../lib/jquery-1.11.2.min.js"></script>
<script src="../lib/jquery-ui-1.11.3.min.js"></script>
<script src="../lib/jquery.event.drag-2.3.0.js"></script>
<script src="../lib/jquery.mousewheel.js"></script>

<script src="../slick.core.js"></script>
<script src="../plugins/slick.autotooltips.js"></script>
<script src="../plugins/slick.cellrangedecorator.js"></script>
<script src="../plugins/slick.cellrangeselector.js"></script>
<script src="../plugins/slick.cellcopymanager.js"></script>
<script src="../plugins/slick.cellselectionmodel.js"></script>
<script src="../slick.editors.js"></script>
<script src="../slick.grid.js"></script>

<script>
var grid;
var data = [];
var options = {
editable: true,
enableAddRow: true,
enableCellNavigation: true,
asyncEditorLoading: false,
autoEdit: false, frozenColumn: 3, frozenRow: 7
};

var columns = [
{
id: "selector",
name: "",
field: "num",
width: 30
}
];

for (var i = 0; i < 100; i++) {
columns.push({
id: i,
//name: String.fromCharCode("A".charCodeAt(0) + (i / 26) | 0) +
// String.fromCharCode("A".charCodeAt(0) + (i % 26)),
name: i,
field: i,
width: 60,
editor: FormulaEditor
});
}

/***
* A proof-of-concept cell editor with Excel-like range selection and insertion.
*/
function FormulaEditor(args) {
var _self = this;
var _editor = new Slick.Editors.Text(args);
var _selector;

$.extend(this, _editor);

function init() {
// register a plugin to select a range and append it to the textbox
// since events are fired in reverse order (most recently added are executed first),
// this will override other plugins like moverows or selection model and will
// not require the grid to not be in the edit mode
_selector = new Slick.CellRangeSelector();
_selector.onCellRangeSelected.subscribe(_self.handleCellRangeSelected);
args.grid.registerPlugin(_selector);
}

this.destroy = function () {
_selector.onCellRangeSelected.unsubscribe(_self.handleCellRangeSelected);
grid.unregisterPlugin(_selector);
_editor.destroy();
};

this.handleCellRangeSelected = function (e, args) {
_editor.setValue(
_editor.getValue() +
grid.getColumns()[args.range.fromCell].name +
args.range.fromRow +
":" +
grid.getColumns()[args.range.toCell].name +
args.range.toRow
);
};


init();
}


$(function () {
for (var i = 0; i < 100; i++) {
var d = (data[i] = {});
d["num"] = i;
}

grid = new Slick.Grid("#myGrid", data, columns, options);

grid.setSelectionModel(new Slick.CellSelectionModel());
grid.registerPlugin(new Slick.AutoTooltips());

// set keyboard focus on the grid
grid.getCanvasNode().focus();

var copyManager = new Slick.CellCopyManager();
grid.registerPlugin(copyManager);

copyManager.onPasteCells.subscribe(function (e, args) {
if (args.from.length !== 1 || args.to.length !== 1) {
throw "This implementation only supports single range copy and paste operations";
}

var from = args.from[0];
var to = args.to[0];
var val;
for (var i = 0; i <= from.toRow - from.fromRow; i++) {
for (var j = 0; j <= from.toCell - from.fromCell; j++) {
if (i <= to.toRow - to.fromRow && j <= to.toCell - to.fromCell) {
val = data[from.fromRow + i][columns[from.fromCell + j].field];
data[to.fromRow + i][columns[to.fromCell + j].field] = val;
grid.invalidateRow(to.fromRow + i);
}
}
}
grid.render();
});

grid.onAddNewRow.subscribe(function (e, args) {
var item = args.item;
var column = args.column;
grid.invalidateRow(data.length);
data.push(item);
grid.updateRowCount();
grid.render();
});
})
</script>
</body>
</html>
Loading