{"action":"created","issue":{"url":"https://api.github.com/repos/Zizzamia/ng-tasty/issues/101","labels_url":"https://api.github.com/repos/Zizzamia/ng-tasty/issues/101/labels{/name}","comments_url":"https://api.github.com/repos/Zizzamia/ng-tasty/issues/101/comments","events_url":"https://api.github.com/repos/Zizzamia/ng-tasty/issues/101/events","html_url":"https://github.com/Zizzamia/ng-tasty/issues/101","id":58698612,"number":101,"title":"table doesn't load with new itemsperpage","user":{"login":"rohansp","id":11171608,"avatar_url":"https://avatars.githubusercontent.com/u/11171608?v=3","gravatar_id":"","url":"https://api.github.com/users/rohansp","html_url":"https://github.com/rohansp","followers_url":"https://api.github.com/users/rohansp/followers","following_url":"https://api.github.com/users/rohansp/following{/other_user}","gists_url":"https://api.github.com/users/rohansp/gists{/gist_id}","starred_url":"https://api.github.com/users/rohansp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohansp/subscriptions","organizations_url":"https://api.github.com/users/rohansp/orgs","repos_url":"https://api.github.com/users/rohansp/repos","events_url":"https://api.github.com/users/rohansp/events{/privacy}","received_events_url":"https://api.github.com/users/rohansp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Zizzamia/ng-tasty/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"Zizzamia","id":829214,"avatar_url":"https://avatars.githubusercontent.com/u/829214?v=3","gravatar_id":"","url":"https://api.github.com/users/Zizzamia","html_url":"https://github.com/Zizzamia","followers_url":"https://api.github.com/users/Zizzamia/followers","following_url":"https://api.github.com/users/Zizzamia/following{/other_user}","gists_url":"https://api.github.com/users/Zizzamia/gists{/gist_id}","starred_url":"https://api.github.com/users/Zizzamia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zizzamia/subscriptions","organizations_url":"https://api.github.com/users/Zizzamia/orgs","repos_url":"https://api.github.com/users/Zizzamia/repos","events_url":"https://api.github.com/users/Zizzamia/events{/privacy}","received_events_url":"https://api.github.com/users/Zizzamia/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-02-24T06:24:40Z","updated_at":"2015-02-24T08:38:02Z","closed_at":null,"body":"I have created a dropdown and binded to model gridpagination.count\r\n```js\r\nreturn $http.get(urlApi).then(function (response) {\r\n            $scope.gridpagination = response.data.pagination;\r\n            return {\r\n                'rows': response.data.rows,\r\n                'header': response.data.header,\r\n                'pagination': $scope.gridpagination,\r\n                'sortby': response.data.sortby,\r\n                'sortorder': response.data.sortorder\r\n            }\r\n});\r\n```\r\nI get the required data from the server, however the items per page doesnt bind to the table.\r\nSo initially if I have 10 records per page and I select 25 from dropdown, it still shows 10 records per page.Whereas, when I check the Json returned from the server,it shows 25 records per page..\r\nWhat could be the issue?"},"comment":{"url":"https://api.github.com/repos/Zizzamia/ng-tasty/issues/comments/75717895","html_url":"https://github.com/Zizzamia/ng-tasty/issues/101#issuecomment-75717895","issue_url":"https://api.github.com/repos/Zizzamia/ng-tasty/issues/101","id":75717895,"user":{"login":"rohansp","id":11171608,"avatar_url":"https://avatars.githubusercontent.com/u/11171608?v=3","gravatar_id":"","url":"https://api.github.com/users/rohansp","html_url":"https://github.com/rohansp","followers_url":"https://api.github.com/users/rohansp/followers","following_url":"https://api.github.com/users/rohansp/following{/other_user}","gists_url":"https://api.github.com/users/rohansp/gists{/gist_id}","starred_url":"https://api.github.com/users/rohansp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohansp/subscriptions","organizations_url":"https://api.github.com/users/rohansp/orgs","repos_url":"https://api.github.com/users/rohansp/repos","events_url":"https://api.github.com/users/rohansp/events{/privacy}","received_events_url":"https://api.github.com/users/rohansp/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T08:38:02Z","updated_at":"2015-02-24T08:38:02Z","body":"--app.js\r\nvar app = angular.module(\"MyApp\", ['ngTasty']);\r\n\r\n\r\napp.controller(\"PaginationCtrl\", function ($scope, $http) {\r\n\r\n    $scope.init = {\r\n        'count': 10,\r\n        'page': 1,\r\n        'sortBy': 'CustomerId',\r\n        'sortOrder': 'asc',\r\n        'listItemsPerPage': [10, 25, 50, 100],\r\n        'itemsPerPage': 10,\r\n        'pagination': true\r\n    };\r\n\r\n    $scope.listItemsPerPage = [10, 25, 50, 100];\r\n\r\n    $scope.reloadCallBack = function (params, paramsObj, isreload, value) {\r\n        $scope.getResource(params, paramsObj, isreload, value);\r\n    }\r\n\r\n\r\n    var gridparams;\r\n    var gridparamsObj;\r\n    $scope.getResource = function (params, paramsObj, isreload, value) {\r\n        if (isreload == true) {\r\n            params = gridparams;\r\n            paramsObj = gridparamsObj;\r\n            paramsObj.count = parseInt($scope.gridpagination.count);\r\n        }\r\n        else {\r\n            gridparams = params;\r\n            gridparamsObj = paramsObj;\r\n        }\r\n\r\n        var pageno = paramsObj.page;\r\n        var records = paramsObj.count;\r\n        var urlApi = 'Service1.svc/GetCustomer?pageno=' + pageno + \"&records=\" + records;\r\n        return $http.get(urlApi).then(function (response) {\r\n            $scope.gridpagination = response.data.pagination;\r\n            console.log($scope.gridpagination);\r\n            return {\r\n                'rows': response.data.rows,\r\n                'header': response.data.header,\r\n                'pagination': $scope.gridpagination,\r\n                'sortby': response.data.sortby,\r\n                'sortorder': response.data.sortorder\r\n            }\r\n        });\r\n    }\r\n\r\n\r\n\r\n});\r\n\r\n--DataGridNew.html\r\n<html>\r\n  <head>\r\n  <link href=\"bootstrap.min.css\" rel=\"Stylesheet\"/>\r\n    <script src=\"angular.js\"></script>    \r\n\t<script src=\"app.js\"></script>\r\n    <script src=\"ng-tasty-tpls.min.js\"></script>\r\n  </head>\r\n  <body ng-app=\"MyApp\">\r\n    <div ng-controller=\"PaginationCtrl\">\r\n      <div tasty-table bind-resource-callback=\"getResource\" data-bind-init=\"init\">\r\n\t\t  <table class=\"table table-striped table-condensed\">\r\n\t\t\t<thead>\r\n\t\t\t  <tr>\r\n\t\t\t\t<th>Customer Id</th>\r\n\t\t\t\t<th>Name</th>\r\n\t\t\t\t<th>Country</th>\r\n\t\t\t  </tr>\r\n\t\t\t<thead>\r\n\t\t\t<tbody>\r\n\t\t\t  <tr ng-repeat=\"row in rows\">\r\n\t\t\t\t<td>{{ row.CustomerId }}</td>\r\n\t\t\t\t<td>{{ row.Name }}</td>\r\n\t\t\t\t<td>{{ row.Country }}</td>\r\n\t\t\t  </tr>\r\n\t\t\t</tbody>\r\n\t\t  </table>\r\n\t\t  <div tasty-pagination bind-list-items-per-page=\"listItemsPerPage\" bind-items-per-page=\"itemsPerPage\" >\r\n         \r\n          </div>\r\n          <select ng-model=\"gridpagination.count\" ng-change=\"getResource('','',true,this)\">\r\n          <option>10</option>\r\n          <option>25</option>\r\n          <option>50</option>\r\n          <option>100</option>\r\n          </select>\r\n\t</div>\r\n    \r\n    </div>\r\n  </body>\r\n</html>\r\n"}}