Skip to content

Commit

Permalink
fixing issue with column drag and drop in IE
Browse files Browse the repository at this point in the history
Columns native HTML5 Drag and Drop doesn't work in IE.
#187
  • Loading branch information
igoryan-k committed Jan 11, 2013
1 parent 3f65ee3 commit edf3776
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
11 changes: 8 additions & 3 deletions build/KoGrid.debug.js
Expand Up @@ -2,7 +2,7 @@
* koGrid JavaScript Library
* Authors: https://github.com/ericmbarnard/koGrid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 12/19/2012 10:15:47
* Compiled At: 01/11/2013 15:58:36
***********************************************/

(function (window) {
Expand Down Expand Up @@ -659,6 +659,11 @@ window.kg.EventProvider = function (grid) {
self.setDraggables = function(){
if(!grid.config.jqueryUIDraggable){
grid.$root.find('.kgHeaderSortColumn').attr('draggable', 'true');
if (navigator.userAgent.indexOf("MSIE") != -1)
{
//call native IE dragDrop() to start dragging
grid.$root.find('.kgHeaderSortColumn').bind('selectstart', function () { this.dragDrop(); return false; });
}
} else {
grid.$root.find('.kgHeaderSortColumn').draggable({
helper: 'clone',
Expand Down Expand Up @@ -1891,7 +1896,7 @@ window.kg.StyleProvider = function (grid) {
};

/***********************************************
* FILE: ..\src\classes\SortService.js
* FILE: ..\src\classes\sortService.js
***********************************************/
window.kg.sortService = {
colSortFnCache: {}, // cache of sorting functions. Once we create them, we don't want to keep re-doing it
Expand Down Expand Up @@ -2144,7 +2149,7 @@ window.kg.sortService = {
};

/***********************************************
* FILE: ..\src\classes\DomUtilityService.js
* FILE: ..\src\classes\domUtilityService.js
***********************************************/
var getWidths = function () {
var $testContainer = $('<div></div>');
Expand Down
11 changes: 8 additions & 3 deletions koGrid-2.1.1.debug.js
Expand Up @@ -2,7 +2,7 @@
* koGrid JavaScript Library
* Authors: https://github.com/ericmbarnard/koGrid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 12/19/2012 10:15:47
* Compiled At: 01/11/2013 15:58:36
***********************************************/

(function (window) {
Expand Down Expand Up @@ -659,6 +659,11 @@ window.kg.EventProvider = function (grid) {
self.setDraggables = function(){
if(!grid.config.jqueryUIDraggable){
grid.$root.find('.kgHeaderSortColumn').attr('draggable', 'true');
if (navigator.userAgent.indexOf("MSIE") != -1)
{
//call native IE dragDrop() to start dragging
grid.$root.find('.kgHeaderSortColumn').bind('selectstart', function () { this.dragDrop(); return false; });
}
} else {
grid.$root.find('.kgHeaderSortColumn').draggable({
helper: 'clone',
Expand Down Expand Up @@ -1891,7 +1896,7 @@ window.kg.StyleProvider = function (grid) {
};

/***********************************************
* FILE: ..\src\classes\SortService.js
* FILE: ..\src\classes\sortService.js
***********************************************/
window.kg.sortService = {
colSortFnCache: {}, // cache of sorting functions. Once we create them, we don't want to keep re-doing it
Expand Down Expand Up @@ -2144,7 +2149,7 @@ window.kg.sortService = {
};

/***********************************************
* FILE: ..\src\classes\DomUtilityService.js
* FILE: ..\src\classes\domUtilityService.js
***********************************************/
var getWidths = function () {
var $testContainer = $('<div></div>');
Expand Down
2 changes: 1 addition & 1 deletion koGrid-2.1.1.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/classes/eventProvider.js
Expand Up @@ -33,6 +33,11 @@ window.kg.EventProvider = function (grid) {
self.setDraggables = function(){
if(!grid.config.jqueryUIDraggable){
grid.$root.find('.kgHeaderSortColumn').attr('draggable', 'true');
if (navigator.userAgent.indexOf("MSIE") != -1)
{
//call native IE dragDrop() to start dragging
grid.$root.find('.kgHeaderSortColumn').bind('selectstart', function () { this.dragDrop(); return false; });
}
} else {
grid.$root.find('.kgHeaderSortColumn').draggable({
helper: 'clone',
Expand Down

0 comments on commit edf3776

Please sign in to comment.