Ng-table: Dynamic data-title with ng-repeat

Created on 29 Aug 2013  ·  12Comments  ·  Source: esvit/ng-table

I would like to assign the title dynamically on creation of the html element. It seem the title parser work before the assignment. If i inspect the elements in chrome the title is set but the thead element is missing.

<table ng-table="tableParams" show-filter="true" class="table table-striped">
    <tr ng-repeat="item in items">
        <td data-title="{{key}}" ng-repeat="(key, value) in item">
            {{value}}
        </td>
    </tr>
</table>

Most helpful comment

Are there any plans to actually fix this to accept dynamic inputs for the data-title? I tried using a function and it looked promising but for some odd reason the function will not accept any dynamic inputs either it only takes hard coded values. The fix proposed above doesn't seem to be a very good one IMHO.

Garfield

All 12 comments

+1

+1

+1

+1

Hey @esvit I like your work and appreciate the effort to solve this issue and all those we ask for fixes :).

In this case the collection columns seems to be hardcoded and despite I added ng-repeat = 'a in schema', within the th, when I inspect html code still see column in $columns within the th. Is it quite weird. I'd vote as simpler solution add support to the example given by @Ebolon, just support the placeholder for the data-title

Thanks and regards.

Apologies for my previous comment, I was trying with 0.3.0 version. I downloaded 0.3.1 and worked as expected. The only thing I found is a backward compatibility issue with angular version wich brakes the pagination widget. My app runs with angular 1.0.8 and I get this message TypeError: Object # has no method 'debug'. Googling it I found that $log.debug is available from 1.1.2 onwards. No big deal, hope this helps to develepment purpose.

BTW, When is planned to do a new release throug bower with this fix ?

Maxi

Definetly, avoid $log.debug sentences bring backward compatibility with Angular 0.8. Any chance of disable logs trough tableParams, for example ?

Thanks and Regards.

+1

+1 for the ability to disable $log.debug

+1

Are there any plans to actually fix this to accept dynamic inputs for the data-title? I tried using a function and it looked promising but for some odd reason the function will not accept any dynamic inputs either it only takes hard coded values. The fix proposed above doesn't seem to be a very good one IMHO.

Garfield

+1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jlebleu picture jlebleu  ·  3Comments

ulise picture ulise  ·  5Comments

penchiang picture penchiang  ·  5Comments

batjko picture batjko  ·  3Comments

zam6ak picture zam6ak  ·  20Comments