{"action":"created","issue":{"url":"https://api.github.com/repos/ducksboard/gridster.js/issues/461","labels_url":"https://api.github.com/repos/ducksboard/gridster.js/issues/461/labels{/name}","comments_url":"https://api.github.com/repos/ducksboard/gridster.js/issues/461/comments","events_url":"https://api.github.com/repos/ducksboard/gridster.js/issues/461/events","html_url":"https://github.com/ducksboard/gridster.js/issues/461","id":48016715,"number":461,"title":"[IE11] Gridster.sort_by_row_and_col_asc","user":{"login":"e-karim","id":1154500,"avatar_url":"https://avatars.githubusercontent.com/u/1154500?v=3","gravatar_id":"","url":"https://api.github.com/users/e-karim","html_url":"https://github.com/e-karim","followers_url":"https://api.github.com/users/e-karim/followers","following_url":"https://api.github.com/users/e-karim/following{/other_user}","gists_url":"https://api.github.com/users/e-karim/gists{/gist_id}","starred_url":"https://api.github.com/users/e-karim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-karim/subscriptions","organizations_url":"https://api.github.com/users/e-karim/orgs","repos_url":"https://api.github.com/users/e-karim/repos","events_url":"https://api.github.com/users/e-karim/events{/privacy}","received_events_url":"https://api.github.com/users/e-karim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-11-06T21:25:54Z","updated_at":"2015-03-10T15:01:01Z","closed_at":null,"body":"I have a strange behavior when my widgets have the same col/row:\r\n```javascript\r\n<ul>\r\n       <li data-row=\"1\" data-col=\"1\" data-sizex=\"1\" data-sizey=\"1\">A</li>\r\n       <li data-row=\"1\" data-col=\"1\" data-sizex=\"1\" data-sizey=\"1\">B</li>\r\n       <li data-row=\"1\" data-col=\"1\" data-sizex=\"1\" data-sizey=\"1\">C</li>\r\n</ul>\r\n```\r\nWith IE11, the order is reversed (C, B, A) and on Firefox or Chrome it does not alter the original order (A, B, C) in Gridster.sort_by_row_and_col_asc. \r\nIn fn.get_widgets_from_DOM, the fn.register_widget do the necessary work to arrange the widgets.\r\n\r\nI've solved my issue by changing the implementation like this:\r\n```javascript\r\nGridster.sort_by_row_and_col_asc = function (widgets) {\r\n        widgets = widgets.sort(function (a, b) {\r\n            if (a.row === b.row && a.col === b.col) {\r\n                return 0;\r\n            }\r\n            if (a.row > b.row || a.row === b.row && a.col > b.col) {\r\n                return 1;\r\n            }\r\n            return -1;\r\n        });\r\n\r\n        return widgets;\r\n    };\r\n```"},"comment":{"url":"https://api.github.com/repos/ducksboard/gridster.js/issues/comments/78071827","html_url":"https://github.com/ducksboard/gridster.js/issues/461#issuecomment-78071827","issue_url":"https://api.github.com/repos/ducksboard/gridster.js/issues/461","id":78071827,"user":{"login":"romgen","id":2144963,"avatar_url":"https://avatars.githubusercontent.com/u/2144963?v=3","gravatar_id":"","url":"https://api.github.com/users/romgen","html_url":"https://github.com/romgen","followers_url":"https://api.github.com/users/romgen/followers","following_url":"https://api.github.com/users/romgen/following{/other_user}","gists_url":"https://api.github.com/users/romgen/gists{/gist_id}","starred_url":"https://api.github.com/users/romgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romgen/subscriptions","organizations_url":"https://api.github.com/users/romgen/orgs","repos_url":"https://api.github.com/users/romgen/repos","events_url":"https://api.github.com/users/romgen/events{/privacy}","received_events_url":"https://api.github.com/users/romgen/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T15:01:01Z","updated_at":"2015-03-10T15:01:01Z","body":"Actually, Chrome got a similiar problem when having too many items.\r\nI have an 8 (columns) x 3 (rows) grid.\r\nWhen having more than 10 list items when calling gridster(), the order seems to be completely random.\r\n\r\nFirefox and IE (with the patch from above) work fine.\r\n"}}