Skip to content

Instantly share code, notes, and snippets.

@nbaksalyar
Created June 18, 2012 00:35
Show Gist options
  • Save nbaksalyar/2946169 to your computer and use it in GitHub Desktop.
Save nbaksalyar/2946169 to your computer and use it in GitHub Desktop.
SlickGrid Patch
From 886643475ed685d3c00d69073365b56950100216 Mon Sep 17 00:00:00 2001
From: Nikita Baksalyar <n.baksalyar@yandex.ru>
Date: Mon, 18 Jun 2012 05:16:09 +0500
Subject: Fix for multiple rows selection using 'Shift' and arrow keys on grids without 'multiSelect'.
---
plugins/slick.rowselectionmodel.js | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/plugins/slick.rowselectionmodel.js b/plugins/slick.rowselectionmodel.js
index fbf8468..33fa6e0 100644
--- a/plugins/slick.rowselectionmodel.js
+++ b/plugins/slick.rowselectionmodel.js
@@ -96,6 +96,10 @@
}
function handleKeyDown(e) {
+ if (!_grid.getOptions().multiSelect) {
+ return false;
+ }
+
var activeRow = _grid.getActiveCell();
if (activeRow && e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey && (e.which == 38 || e.which == 40)) {
var selectedRows = getSelectedRows();
--
1.7.4.msysgit.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment