Closed mustafabereket closed 7 years ago
md-on-reorder -- you have to create a function that request JSON data from the server w/ paging and Sorting Capability in JSON format. the ordering takes place in server side. or just add Filter on the header.
"you have to create a function that request JSON data from the server w/ paging and Sorting Capability in JSON format."
I can re-fill my array with same information, but what did you mean by "with paging and sorting capability"? if I am going to sort my array in the server side, what is the whole point using md-table's sorting functionality?
You need to pipe your repeater through orderBy
.
<tr md-row ng-repeat="item in tsCtrl.savedTasks | orderBy: tsCtrl.query2.order | limitTo: tsCtrl.query2.limit: (tsCtrl.query2.page - 1) * tsCtrl.query2.limit" >
If you are pulling items down from the server in chunks (i.e. paginating on the server) then @jansen07 is right, you will need to utilize md-on-reorder
and dispatch a query to the server to sort the items.
Thank you so much @daniel-nagy ! this solves my problem. I appreciate it!
Hey There,
I am pretty sure I am doing something wrong, but for some reason I couldnt find it.
Expected Behavior:
When you click sort icon next to the column name, it should sort the table in 'Ascending' order first. Click it second time, it should order 'Descending' order.
Behavior I get:
Doesnt sort at all.
Code I have:
Does anyone see what I might possibly be missing?
Thanks,