Skip to content

Commit

Permalink
add option to enable text selection in grid cells
Browse files Browse the repository at this point in the history
  • Loading branch information
saks committed Dec 9, 2010
1 parent 5f88203 commit 61b294c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions slick.grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ if (typeof Slick === "undefined") {
editorFactory: null,
cellFlashingCssClass: "flashing",
selectedCellCssClass: "selected",
multiSelect: true
multiSelect: true,
enableTextSelectionOnCells: false
},
gridData;

Expand Down Expand Up @@ -237,7 +238,7 @@ if (typeof Slick === "undefined") {
// selection in grid cells (grid body) is already unavailable in
// all browsers except IE
disableSelection($headers); // disable all text selection in header (including input and textarea)
$viewport.bind("selectstart.ui", function (event) { return $(event.target).is("input,textarea"); }); // disable text selection in grid cells except in input and textarea elements (this is IE-specific, because selectstart event will only fire in IE)
if (!options.enableTextSelectionOnCells) $viewport.bind("selectstart.ui", function (event) { return $(event.target).is("input,textarea"); }); // disable text selection in grid cells except in input and textarea elements (this is IE-specific, because selectstart event will only fire in IE)

createColumnHeaders();
setupColumnSort();
Expand Down

0 comments on commit 61b294c

Please sign in to comment.