{"action":"opened","issue":{"url":"https://api.github.com/repos/lorenzofox3/Smart-Table/issues/393","labels_url":"https://api.github.com/repos/lorenzofox3/Smart-Table/issues/393/labels{/name}","comments_url":"https://api.github.com/repos/lorenzofox3/Smart-Table/issues/393/comments","events_url":"https://api.github.com/repos/lorenzofox3/Smart-Table/issues/393/events","html_url":"https://github.com/lorenzofox3/Smart-Table/issues/393","id":72100426,"number":393,"title":"StPipe and table reload from outside","user":{"login":"matgardon","id":3001601,"avatar_url":"https://avatars.githubusercontent.com/u/3001601?v=3","gravatar_id":"","url":"https://api.github.com/users/matgardon","html_url":"https://github.com/matgardon","followers_url":"https://api.github.com/users/matgardon/followers","following_url":"https://api.github.com/users/matgardon/following{/other_user}","gists_url":"https://api.github.com/users/matgardon/gists{/gist_id}","starred_url":"https://api.github.com/users/matgardon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matgardon/subscriptions","organizations_url":"https://api.github.com/users/matgardon/orgs","repos_url":"https://api.github.com/users/matgardon/repos","events_url":"https://api.github.com/users/matgardon/events{/privacy}","received_events_url":"https://api.github.com/users/matgardon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-30T08:36:19Z","updated_at":"2015-04-30T08:36:19Z","closed_at":null,"body":"First of all, thanks for the hard work, the simplicity & efficiency of your smart-table, I very much like most of the paradigms.\r\n\r\nI've searched for past issues for my problem, but couldn't find my exact scenario, nor any sense of something that I might not have \"gotten\" from your philosophy with smart-table, so here is my issue.\r\n\r\nI'm using your basic pipe/ajax example (with pagination), and things are working fine. I have no specific code to provide, as my code is exactly like your example of a custom pipe function loading data from a server.\r\n\r\nIn the case of your example, you handle the \"initial/first load of data\" case using the linking function of your stPipe directive (on post link, call ctrl.pipe()). \r\n\r\nBut this way of handling things works fine only for the initial creation of the directive : afterwards, I need to reload the table based on external changes (a user profile change in my application causes the data to be outdated so I want to reload the table / call the pipe function again). \r\n\r\nI have the option to reload my entire state upon this user profile change, but that's far from perfect (other elements in my view do not need to be reloaded, only the table).\r\n\r\nI've tried to call my custom pipe function from outside the directive, but this way the tableState.pagination.numberOfPages is not provided, thus not updated, causing a UI bug.\r\n\r\nI could also re-set the pipe function to force the intial post link function to execute again, but that's not ideal either.\r\n\r\nI'm considering 2 options : \r\n\r\n- modifying your stPagination directive to be able to do 2 way data-binding onto the numberOfPages attribute, so that I can update it from the outside when calling the pipe function without needing to pass-in the tableState Parameter. \r\n\r\n- providing a reload() method from the directive to the outside world, method that would then have access internally to the tableState, and call the custom pipe function with this tableState. This pretty much sums up to the ng-table table.reload() feature.\r\n\r\nWhat are you thoughts on the problem ? I I do a pull request, would you consider my proposition ?"}}