Skip to content

Added "refresh" method to table api to keep table values in sync with server. #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions angular-mesa.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ declare namespace angular.apMesa {
deselectAll: () => void;
toggleSelectAll: () => void;
setLoading: (isLoading: boolean, triggerDigest?: boolean) => void;
// In case if server values are keep changing, refresh can be called programmatically to keep the table data in sync with server.
refresh: () => void;
reset: () => void;
clearFilters: () => void;
// Resets rows' sorting order to whatever options.initialSorts. You can also pass an explicit array of IInitialSort objects.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angularjs-table",
"version": "2.21.5",
"version": "2.21.6",
"main": [
"./dist/ap-mesa.js",
"./dist/ap-mesa.css"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angularjs-table",
"version": "2.21.5",
"version": "2.21.6",
"license": "Apache License, v2.0",
"dependencies": {
"angular": "^1.6",
Expand Down
3 changes: 3 additions & 0 deletions src/directives/apMesa.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,9 @@
scope.$digest();
}
},
refresh: function() {
scope.$broadcast('apMesa:forceRefresh');
},
reset: function() {
scope.resetOffset();
resetState(scope);
Expand Down