Comments (7)
How about,
// my controller
$scope.onPageChange = function (page) {
// do stuff
}
<md-data-table-toolbar layout-align="end">
<md-data-table-pagination on-change="onPageChange"></md-data-table-pagination>
</md-data-table-toolbar>
I had this implemented at one point then discarded it during a refactor but I could reimplement it again. I agree this would be nice so you wouldn't have to register $watch
listeners. Would you care to have the same functionality for the md-filter
(will be md-order
in the next release for better naming convention) attribute?
from md-data-table.
I think components like md-data-table should have lot of event handlers for everything it does, even md-filter
(md-order
). The example shown above is good. Perhaps the parameters should be, page
and limit
.
from md-data-table.
Okay, this is in spot two of the queue behind row selection backgrounds 👍
from md-data-table.
Can you make it so that the pagination and order change event is NOT run when the page is loaded? Instead it should be run only when the page is changed by the user interactively. I'm having some trouble because the page change event is run when the page is first loaded.
Have a look at the <pagination>
directive in this link. I use it in a similar way, but I cannot use the same codes for this because of the event being fired every time the state is loaded.
from md-data-table.
Also I don't understand how you have implemented it in your nutritionController
. Where are the onOrderChange
and onPageChange
event handlers??
from md-data-table.
I'll admit that this needs more work and the reason the function gets triggered on page load is because the ng-change
directive automatically fires in the select dropdown. I'll revisit this after I finish implementing the md-disable-select
attribute.
"Also I don't understand how you have implemented it in your nutritionController. Where are the onOrderChange and onPageChange event handlers??"
I think this is just a mistake on my part. I should of removed the attributes in the template as ng-repeat
is smart enough to know when the values change.
from md-data-table.
@ahmadhsalim I'm not positive but I think master branch of Angular Material contains a fix for ngChange
firing immediately inside mdSelect
. I've pulled down master branch for my current project and it is no longer firing on page load. It looks like they've made some other changes to the template so the styling is not completely accurate but is still very usable.
Now that I have finished md-disable-select
I'm going to revisit this. I'd like to see if i can wrap the function that gets passed to mdTrigger
in a promise API so even if the developer calls it in their template a loading indicator will be displayed.
update
I've had a moment now to investigate why the function is being triggered unexpectedly and it is actually the same issue that I opened awhile back #3233
from md-data-table.
Related Issues (20)
- Global setting
- How to select all rows? HOT 8
- Exclude certain rows from sorting
- Please bump version and publish to npm
- Custom cell disable using value - Md-data-table - AngularJS
- Sorting when using md-virtual-repeat and md-on-demand
- how can i have a fixed header when using md-vritual-repeat-conatiner
- Missing rows with mdVirtualRepeat
- Sticky column HOT 2
- Multiple parameter ordering HOT 1
- Refresh data table after edit, add, update.
- $mdEditDialog large throws an error while calling $http service on save.
- how to print md data table without order by arrow icon HOT 1
- Pagination localisation options are insufficient
- Live Demo has security breach (Kinda) HOT 3
- maintain sorting state in and out of session
- md-table-pagination not working for server side binding(other than page 1) HOT 1
- Selectable Columns Callback is not working
- Get limited data from server rather binding all data
- Bring md-select selected from server
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from md-data-table.