-
Notifications
You must be signed in to change notification settings - Fork 19
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
Column names not showing when setting columns dynamically #12
Comments
Hi It is a supported use case adding columns at runtime, with help of You can solve this requirement with plain Angular: <thead>
<tr>
<th ng-repeat="column in columnNames">{{column}}</th>
</tr>
</thead> |
Ok, I tried using plain Angular, but it didn't work either =/... Here's the code: The directive:
The template:
The element:
The controller sets
The table shows the values correctly at first. Everything ok. The problem is when I size down the screen and the table enters responsive mode. When the table's layout changes, the column names disappear. |
Could it be a typo in the template where you have: Other than that, I don't see why it wouldn't work. Can you please provide a plunker? |
I made this one without using directives, but I got the same result: https://embed.plnkr.co/QH65eaSF15yeZkT48XrA/ |
It may be some scoping issue. If there's some static text around where there's that I see nothing that should prevent you from using this solution. One thing you may want to try is creating a directive with a higher precedence than this component (priority > 0) to render each |
I tried changing the priority of my directive. I never needed to set the priority of a directive before, so I set 'priority' to 1. It didn't work =/ Should I create another directive that will contain my current one? |
I don't think that will help. My best guess is that when the
it fails somewhere to retrieve the correct column name during interpolation. Each DOM element should have a separate |
I see. Indeed Thanks! |
I worked around it by adding |
There's an incompability with the To work around this limitation, either use static There's a quick and dirty check that could be applied but still wouldn't solve most dynamic setups. So I'll leave this open for anyone interested in tackling this as an enhancement. |
Fix released in v0.2.0. plunker updated: https://embed.plnkr.co/pSoSnRzf0gNMVsH5nFs4/ |
Hello,
I made a directive and put the your table in it (a table with 'wt-responsive-table' directive), but I am setting the columns dynamically with ng-repeat on a list of column names. When I size down the screen (to 'responsive mode'), the column names don't appear. Here's part of the code I used:
I prepend the thead to the table, afterwards.
The text was updated successfully, but these errors were encountered: