{"action":"created","issue":{"url":"https://api.github.com/repos/MoonStorm/trNgGrid/issues/209","labels_url":"https://api.github.com/repos/MoonStorm/trNgGrid/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/MoonStorm/trNgGrid/issues/209/comments","events_url":"https://api.github.com/repos/MoonStorm/trNgGrid/issues/209/events","html_url":"https://github.com/MoonStorm/trNgGrid/issues/209","id":106778242,"number":209,"title":"Delay filtering until user stops typing","user":{"login":"vanpouckesven","id":2194636,"avatar_url":"https://avatars.githubusercontent.com/u/2194636?v=3","gravatar_id":"","url":"https://api.github.com/users/vanpouckesven","html_url":"https://github.com/vanpouckesven","followers_url":"https://api.github.com/users/vanpouckesven/followers","following_url":"https://api.github.com/users/vanpouckesven/following{/other_user}","gists_url":"https://api.github.com/users/vanpouckesven/gists{/gist_id}","starred_url":"https://api.github.com/users/vanpouckesven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vanpouckesven/subscriptions","organizations_url":"https://api.github.com/users/vanpouckesven/orgs","repos_url":"https://api.github.com/users/vanpouckesven/repos","events_url":"https://api.github.com/users/vanpouckesven/events{/privacy}","received_events_url":"https://api.github.com/users/vanpouckesven/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-16T13:52:48Z","updated_at":"2015-09-16T16:00:51Z","closed_at":null,"body":"Hello\r\n\r\nI'm wondering if it's possible to delay the filtering of a column / table until the user stops typing. Currently we have a table with 1500 records that are loaded in memory. This is working great but when searching the grid reacts a bit slowly. I think that the perception would be better if the grid isn't searching after each letter but only when the user stops typing. \r\n\r\nNormally this kind of feature can be achieved by setting a timeout when the user enters and clears the timeout when the user is still typing after x milliseconds. \r\n\r\nI've been looking into the code if it was possible to change this behavior but i'm guessing since the filtering is happening client side, the filtering is automatically triggered due to the model bind of the columnOptions?\r\n\r\nCould this be achieved easily or with an extension of the current code? \r\n\r\nThanks in advance!\r\n\r\nSven\r\n"},"comment":{"url":"https://api.github.com/repos/MoonStorm/trNgGrid/issues/comments/140787913","html_url":"https://github.com/MoonStorm/trNgGrid/issues/209#issuecomment-140787913","issue_url":"https://api.github.com/repos/MoonStorm/trNgGrid/issues/209","id":140787913,"user":{"login":"MoonStorm","id":2178827,"avatar_url":"https://avatars.githubusercontent.com/u/2178827?v=3","gravatar_id":"","url":"https://api.github.com/users/MoonStorm","html_url":"https://github.com/MoonStorm","followers_url":"https://api.github.com/users/MoonStorm/followers","following_url":"https://api.github.com/users/MoonStorm/following{/other_user}","gists_url":"https://api.github.com/users/MoonStorm/gists{/gist_id}","starred_url":"https://api.github.com/users/MoonStorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoonStorm/subscriptions","organizations_url":"https://api.github.com/users/MoonStorm/orgs","repos_url":"https://api.github.com/users/MoonStorm/repos","events_url":"https://api.github.com/users/MoonStorm/events{/privacy}","received_events_url":"https://api.github.com/users/MoonStorm/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T16:00:51Z","updated_at":"2015-09-16T16:00:51Z","body":"Yes it can be achieved. It's the first time someone is asking for this feature, since loading a great number of rows in memory client-side is usually a bad idea. \r\n\r\nThe mechanism you described is being used for server-side mode. Check the [demo site](http://moonstorm.github.io/trNgGrid/release/#/ServerSide) to see it in action.\r\n\r\nMy suggestion is to fork the project and implement this yourself. In client-side mode, there is a single function that gets called on model change that handles recomputing the items visible on the current page. As you already mentioned, you need to delay the call to this method on a timer and also cancel the timer when the same event occurred. \r\nYou could use as inspiration the code for server-side mode, but that's slightly more complex since the call must be made instantly in case one of the order glyph is being clicked or a page transition is requested."}}