javascript - How to sort out the data in the table after the data was loaded from the data base? -
i have data in database , displayed on page. necessary sort data out pressing column title.
after opening page see empty table filled data database within 5~10 seconds.
if use plugin angularjs datatables , insert tag datatable="ng"
, 1 can see icons sorting after pressing of icons make table invisible.
here's code.
<div class="table-responsive"> <table class="table table-striped" ng-controller="mostpopularstablecontroller"> <thead ibox-tool> <tr ts-repeat> <th>title</th> <th></th> <th>link</th> <th>network</th> <th>count</th> <th>clicks</th> <th>ctr</th> </tr> </thead> <tbody> <tr ng-repeat="data in mostpopulars"> <td><img src="{{data.topimages}}" width="50" height="50" /></td> <td><b>description:</b>{{data.title}}</td> <td> <a href="{{data.link}}"><img src="./img/link.png" width="15" height="15" /></a> </td> <td>{{data.networkname}}</td> <td>{{data.count}}</td> <td>{{data.adclicks}}</td> <td>{{data.adctr}}</td> </tr> </tbody> </table> </div>
you can use jquery libraries it. 1 of 1
https://datatables.net/examples/basic_init/table_sorting.html
it supports client side server side sorting using ajax.it easy integrate.
Comments
Post a Comment