Skip to content
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

Sort doesn't work if ng-repeat is used for populating the header <th> #14

Open
shirishc opened this issue Feb 28, 2017 · 6 comments
Open

Comments

@shirishc
Copy link

shirishc commented Feb 28, 2017

The sorting by clicking the header and toggle-arrow-tiny works nicely normally but doesn't work well when I use ng-repeat like this shown below. I still get the headers with correct text but no sorting or the toggle icons on the headers.

<th ng-repeat="curr_header in headers">{{curr_header}}</th>

Can you please help ?

@jquinter
Copy link

+1. It just doesn't work. Personally I tried with ng-attr in order to specify parameters for footable, and it doesn't work neither.

@Sumedha-Scry
Copy link

I have a similar issue. I use ng-repeat for th and it screws up the footable-redraw, when i hard code the headers it works...

@Sumedha-Scry
Copy link

My issue is solved - used load-when

@Moxy1683
Copy link

@Sumedha-Scry: Can you explain how to use load-when in with a value bound to angular scope? Does it work along with data-hide attribute?

@Sumedha-Scry
Copy link

Sumedha-Scry commented Jun 5, 2017

@Moxy1683 e.g to use load-when:
assume two scope variables :
data : has some rows in json format. for eg: [{'id':1,'name':'test'}]
headers : contains keys from data. continuing above eg. ['id','name']

<div  ng-if="data.length">
<table class="footable" load-when="data">
    <thead>
         <tr>
             <th ng-repeat="header in headers">{{header}}</th>
         </tr>
    </thead>
    <tbody>
         <tr  ng-repeat="row in data">
             <td ng-repeat="h in headers">{{row[h]}}</td>
         </tr>
    </tbody>
</table>
</div>

To answer your second question, I have not tried it but theoretically it should work. Hope this helps.

@abmeman
Copy link

abmeman commented Sep 1, 2017

It's not working bro same issue occured if any one get solution plz post it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants