javascript - How to track the progress of a large OrderBy -


i have standard enough dynamically filled table in bootstrap instantiated following definition

<table>     <tr ng-repeat="c in controller.items :         orderby:controller.predicate:controller.reverse">...</tr> </table> 

and pretty standard function that, when called string argument, sort table, using string argument predicate.

controller.ordercasesby = function (predicate) {     controller.reverse = (controller.predicate === predicate) ?          !controller.reverse : false;     controller.predicate = predicate; } 

the page i'm working on potentially has upwards thousand rows, trying figure out way track progress of ordering function , update progress bar accordingly.

if case trying track progress of entire table rendering first time, attach ng-init function each repeated row update progress bar whenever it's called. ng-init functions don't seem called when table reordered, however, wondering if there achieve similar effect.

if can't, i'd love hear suggestions on alternative ways track this.

you can add object parameter ordering function, updates value property (or call whatever want), use object.value render status indicator see fit.

since said you're open alternatives, don't need actively reverse @ (and therefore don't need indicate progress it). ngrepeat allows track index, means can display them in reverse index order.

example:

<table>     <tr ng-repeat="c in controller.items track $index">         <td ng-model="controller.items[controller.items.length-($index+1)]"></td>     </tr> </table> 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

python 3.x - PyQt5 - Signal : pyqtSignal no method connect -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)