slickgrid
Advanced tools
Comparing version 2.3.12 to 2.3.13
@@ -16,2 +16,4 @@ /*** | ||
* // the last 2 checkboxes titles | ||
* hideForceFitButton: false, // show/hide checkbox near the end "Force Fit Columns" (default:false) | ||
* hideSyncResizeButton: false, // show/hide checkbox near the end "Synchronous Resize" (default:false) | ||
* forceFitTitle: "Force fit columns", // default to "Force fit columns" | ||
@@ -33,2 +35,3 @@ * syncResizeTitle: "Synchronous resize", // default to "Synchronous resize" | ||
var columnCheckboxes; | ||
var onColumnsChanged = new Slick.Event(); | ||
@@ -39,2 +42,4 @@ var defaults = { | ||
// the last 2 checkboxes titles | ||
hideForceFitButton: false, | ||
hideSyncResizeButton: false, | ||
forceFitTitle: "Force fit columns", | ||
@@ -105,25 +110,32 @@ syncResizeTitle: "Synchronous resize" | ||
var forceFitTitle = (options.columnPicker && options.columnPicker.forceFitTitle) || defaults.forceFitTitle; | ||
$("<hr/>").appendTo($list); | ||
$li = $("<li />").appendTo($list); | ||
$input = $("<input type='checkbox' />").data("option", "autoresize"); | ||
$("<label />") | ||
.text(forceFitTitle) | ||
.prepend($input) | ||
.appendTo($li); | ||
if (grid.getOptions().forceFitColumns) { | ||
$input.attr("checked", "checked"); | ||
if (options.columnPicker && (!options.columnPicker.hideForceFitButton || !options.columnPicker.hideSyncResizeButton)) { | ||
$("<hr/>").appendTo($list); | ||
} | ||
var syncResizeTitle = (options.columnPicker && options.columnPicker.syncResizeTitle) || defaults.syncResizeTitle; | ||
$li = $("<li />").appendTo($list); | ||
$input = $("<input type='checkbox' />").data("option", "syncresize"); | ||
$("<label />") | ||
.text(syncResizeTitle) | ||
.prepend($input) | ||
.appendTo($li); | ||
if (grid.getOptions().syncColumnCellResize) { | ||
$input.attr("checked", "checked"); | ||
if (!(options.columnPicker && options.columnPicker.hideForceFitButton)) { | ||
var forceFitTitle = (options.columnPicker && options.columnPicker.forceFitTitle) || options.forceFitTitle; | ||
$li = $("<li />").appendTo($list); | ||
$input = $("<input type='checkbox' />").data("option", "autoresize"); | ||
$("<label />") | ||
.text(forceFitTitle) | ||
.prepend($input) | ||
.appendTo($li); | ||
if (grid.getOptions().forceFitColumns) { | ||
$input.attr("checked", "checked"); | ||
} | ||
} | ||
if (!(options.columnPicker && options.columnPicker.hideSyncResizeButton)) { | ||
var syncResizeTitle = (options.columnPicker && options.columnPicker.syncResizeTitle) || options.syncResizeTitle; | ||
$li = $("<li />").appendTo($list); | ||
$input = $("<input type='checkbox' />").data("option", "syncresize"); | ||
$("<label />") | ||
.text(syncResizeTitle) | ||
.prepend($input) | ||
.appendTo($li); | ||
if (grid.getOptions().syncColumnCellResize) { | ||
$input.attr("checked", "checked"); | ||
} | ||
} | ||
$menu | ||
@@ -194,2 +206,3 @@ .css("top", e.pageY - 10) | ||
grid.setColumns(visibleColumns); | ||
onColumnsChanged.notify({columns: visibleColumns, grid: grid}); | ||
} | ||
@@ -206,3 +219,4 @@ } | ||
"getAllColumns": getAllColumns, | ||
"destroy": destroy | ||
"destroy": destroy, | ||
"onColumnsChanged": onColumnsChanged | ||
}; | ||
@@ -209,0 +223,0 @@ } |
@@ -25,2 +25,4 @@ /*** | ||
* // the last 2 checkboxes titles | ||
* hideForceFitButton: false, // show/hide checkbox near the end "Force Fit Columns" | ||
* hideSyncResizeButton: false, // show/hide checkbox near the end "Synchronous Resize" | ||
* forceFitTitle: "Force fit columns", // default to "Force fit columns" | ||
@@ -103,2 +105,4 @@ * syncResizeTitle: "Synchronous resize", // default to "Synchronous resize" | ||
var _defaults = { | ||
hideForceFitButton: false, | ||
hideSyncResizeButton: false, | ||
fadeSpeed: 250, | ||
@@ -159,2 +163,6 @@ forceFitTitle: "Force fit columns", | ||
function destroy() { | ||
_self.onBeforeMenuShow.unsubscribe(); | ||
_self.onMenuClose.unsubscribe(); | ||
_self.onCommand.unsubscribe(); | ||
_self.onColumnsChanged.unsubscribe(); | ||
_grid.onColumnsReordered.unsubscribe(updateColumnOrder); | ||
@@ -254,25 +262,32 @@ $(document.body).off("mousedown", handleBodyMouseDown); | ||
var forceFitTitle = (_options.gridMenu && _options.gridMenu.forceFitTitle) || _defaults.forceFitTitle; | ||
$("<hr/>").appendTo($list); | ||
$li = $("<li />").appendTo($list); | ||
$input = $("<input type='checkbox' />").data("option", "autoresize"); | ||
$("<label />") | ||
.text(forceFitTitle) | ||
.prepend($input) | ||
.appendTo($li); | ||
if (_grid.getOptions().forceFitColumns) { | ||
$input.attr("checked", "checked"); | ||
if (_options.gridMenu && (!_options.gridMenu.hideForceFitButton || !_options.gridMenu.hideSyncResizeButton)) { | ||
$("<hr/>").appendTo($list); | ||
} | ||
var syncResizeTitle = (_options.gridMenu && _options.gridMenu.syncResizeTitle) || _defaults.syncResizeTitle; | ||
$li = $("<li />").appendTo($list); | ||
$input = $("<input type='checkbox' />").data("option", "syncresize"); | ||
$("<label />") | ||
.text(syncResizeTitle) | ||
.prepend($input) | ||
.appendTo($li); | ||
if (_grid.getOptions().syncColumnCellResize) { | ||
$input.attr("checked", "checked"); | ||
if (!(_options.gridMenu && _options.gridMenu.hideForceFitButton)) { | ||
var forceFitTitle = (_options.gridMenu && _options.gridMenu.forceFitTitle) || _defaults.forceFitTitle; | ||
$li = $("<li />").appendTo($list); | ||
$input = $("<input type='checkbox' />").data("option", "autoresize"); | ||
$("<label />") | ||
.text(forceFitTitle) | ||
.prepend($input) | ||
.appendTo($li); | ||
if (_grid.getOptions().forceFitColumns) { | ||
$input.attr("checked", "checked"); | ||
} | ||
} | ||
if (!(_options.gridMenu && _options.gridMenu.hideSyncResizeButton)) { | ||
var syncResizeTitle = (_options.gridMenu && _options.gridMenu.syncResizeTitle) || _defaults.syncResizeTitle; | ||
$li = $("<li />").appendTo($list); | ||
$input = $("<input type='checkbox' />").data("option", "syncresize"); | ||
$("<label />") | ||
.text(syncResizeTitle) | ||
.prepend($input) | ||
.appendTo($li); | ||
if (_grid.getOptions().syncColumnCellResize) { | ||
$input.attr("checked", "checked"); | ||
} | ||
} | ||
var gridMenuWidth = $menu.width(); | ||
@@ -394,2 +409,6 @@ | ||
_grid.setColumns(visibleColumns); | ||
_self.onColumnsChanged.notify({ | ||
"grid": _grid, | ||
"columns": visibleColumns | ||
}, e, _self); | ||
} | ||
@@ -411,5 +430,6 @@ } | ||
"onMenuClose": new Slick.Event(), | ||
"onCommand": new Slick.Event() | ||
"onCommand": new Slick.Event(), | ||
"onColumnsChanged": new Slick.Event() | ||
}); | ||
} | ||
})(jQuery); |
@@ -145,3 +145,3 @@ (function ($) { | ||
} else { | ||
$status.text(_options.showPageText.replace('{pageNum}', pagingInfo.pageNum + "").replace('{pageCount}', pagingInfo.totalPages + "")); | ||
$status.text(_options.showPageText.replace('{pageNum}', pagingInfo.pageNum + 1 + "").replace('{pageCount}', pagingInfo.totalPages + "")); | ||
} | ||
@@ -148,0 +148,0 @@ } |
{ | ||
"name": "slickgrid", | ||
"version": "2.3.12", | ||
"version": "2.3.13", | ||
"description": "A lightning fast JavaScript grid/spreadsheet", | ||
@@ -5,0 +5,0 @@ "main": "slick.core.js", |
@@ -29,3 +29,3 @@ (function ($) { | ||
onCopySuccess: optional handler to run when copy action is complete | ||
newRowCreator: function to add rows to table if paste overflows bottom of table | ||
newRowCreator: function to add rows to table if paste overflows bottom of table, if this function is not provided new rows will be ignored. | ||
readOnlyMode: suppresses paste | ||
@@ -179,3 +179,5 @@ */ | ||
var addRows = 0; | ||
if(availableRows < destH) | ||
// ignore new rows if we don't have a "newRowCreator" | ||
if(availableRows < destH && _options.newRowCreator) | ||
{ | ||
@@ -182,0 +184,0 @@ var d = _grid.getData(); |
@@ -91,2 +91,6 @@ (function ($) { | ||
} | ||
else if (!_options.selectActiveCell) { | ||
// clear the previous selection once the cell changes | ||
setSelectedRanges([]); | ||
} | ||
} | ||
@@ -93,0 +97,0 @@ |
@@ -84,3 +84,3 @@ (function ($) { | ||
function setSelectedRanges(ranges) { | ||
// simle check for: empty selection didn't change, prevent firing onSelectedRangesChanged | ||
// simple check for: empty selection didn't change, prevent firing onSelectedRangesChanged | ||
if ((!_ranges || _ranges.length === 0) && (!ranges || ranges.length === 0)) { return; } | ||
@@ -103,3 +103,5 @@ _ranges = ranges; | ||
var activeRow = _grid.getActiveCell(); | ||
if (activeRow && e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey && (e.which == 38 || e.which == 40)) { | ||
if (_grid.getOptions().multiSelect && activeRow | ||
&& e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey | ||
&& (e.which == Slick.keyCode.UP || e.which == Slick.keyCode.DOWN)) { | ||
var selectedRows = getSelectedRows(); | ||
@@ -118,3 +120,3 @@ selectedRows.sort(function (x, y) { | ||
if (e.which == 40) { | ||
if (e.which == Slick.keyCode.DOWN) { | ||
active = activeRow.row < bottom || top == bottom ? ++bottom : ++top; | ||
@@ -121,0 +123,0 @@ } else { |
@@ -217,3 +217,3 @@ /*** | ||
} else { | ||
rtn |= 0; | ||
rtn = rtn || 0; | ||
} | ||
@@ -220,0 +220,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3748721
195
87629