{"action":"created","issue":{"url":"https://api.github.com/repos/free-jqgrid/jqGrid/issues/131","labels_url":"https://api.github.com/repos/free-jqgrid/jqGrid/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/free-jqgrid/jqGrid/issues/131/comments","events_url":"https://api.github.com/repos/free-jqgrid/jqGrid/issues/131/events","html_url":"https://github.com/free-jqgrid/jqGrid/issues/131","id":100840233,"number":131,"title":"How to stop long running grid loading?","user":{"login":"zoltan-fedor","id":3887295,"avatar_url":"https://avatars.githubusercontent.com/u/3887295?v=3","gravatar_id":"","url":"https://api.github.com/users/zoltan-fedor","html_url":"https://github.com/zoltan-fedor","followers_url":"https://api.github.com/users/zoltan-fedor/followers","following_url":"https://api.github.com/users/zoltan-fedor/following{/other_user}","gists_url":"https://api.github.com/users/zoltan-fedor/gists{/gist_id}","starred_url":"https://api.github.com/users/zoltan-fedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zoltan-fedor/subscriptions","organizations_url":"https://api.github.com/users/zoltan-fedor/orgs","repos_url":"https://api.github.com/users/zoltan-fedor/repos","events_url":"https://api.github.com/users/zoltan-fedor/events{/privacy}","received_events_url":"https://api.github.com/users/zoltan-fedor/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/free-jqgrid/jqGrid/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-13T18:44:07Z","updated_at":"2015-08-13T19:17:30Z","closed_at":null,"body":"Hi Oleg,\r\n\r\nThis is a question which might be an enhancement request if it turns out that currently this isn't possible with jqGrid.\r\n\r\nLet me describe the scenario.\r\nI have some grids showing some aggregated data which are driven from some selections made by the user. What is important that to load the data into the grid is very slow (>10s), because that aggregation is heavy on the database (tables with tens/hundreds of millions of rows). This cannot be made any faster on the database side.\r\nThe problem that while the query is loading (<10s), sometimes the user changes his mind and makes a new selections and would like to submit a new loading of the grid. The problem, that there is no \"abort\" method to stop a pending grid refresh, so the user has to wait for the first to finish before a new \"reloadGrid\" can be issued.\r\n\r\nI met a challenge with other slow loading objects (most notably charts) and I usually solve this by creating a global JS variable (or class attribute) to store the AJAX request in it and so I can call an abort on that object to cancel the current request and so I can send a new one. See this method in the accepted answer of http://stackoverflow.com/questions/4342438/cancelling-previous-ajax-request-jquery\r\nThis way the user doesn't need to wait for the original request to finish, while he already knows that he doesn't need that, but the request gets cancelled and the new one sent right away.\r\n\r\nThe question is whether there already is such an \"abort\" method for jqGrid? If not, could one be added to it?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/free-jqgrid/jqGrid/issues/comments/130809234","html_url":"https://github.com/free-jqgrid/jqGrid/issues/131#issuecomment-130809234","issue_url":"https://api.github.com/repos/free-jqgrid/jqGrid/issues/131","id":130809234,"user":{"login":"zoltan-fedor","id":3887295,"avatar_url":"https://avatars.githubusercontent.com/u/3887295?v=3","gravatar_id":"","url":"https://api.github.com/users/zoltan-fedor","html_url":"https://github.com/zoltan-fedor","followers_url":"https://api.github.com/users/zoltan-fedor/followers","following_url":"https://api.github.com/users/zoltan-fedor/following{/other_user}","gists_url":"https://api.github.com/users/zoltan-fedor/gists{/gist_id}","starred_url":"https://api.github.com/users/zoltan-fedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zoltan-fedor/subscriptions","organizations_url":"https://api.github.com/users/zoltan-fedor/orgs","repos_url":"https://api.github.com/users/zoltan-fedor/repos","events_url":"https://api.github.com/users/zoltan-fedor/events{/privacy}","received_events_url":"https://api.github.com/users/zoltan-fedor/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T19:17:30Z","updated_at":"2015-08-13T19:17:30Z","body":"Thank you Oleg for the quick response.\r\nYes, you are right, this could be potentially implemented manually via loadBeforeSend, but it would be nice to get a built-in method, so no manual implementation is required.\r\n\r\nI imagine the option to abort could be useful for all who are having long running queries to load data into the the grid.\r\n\r\nI'm looking forward seeing this as a standard method built into jqGrid!\r\n\r\nThanks!"}}