alalonde / angular-scrollable-table

A fixed header table directive for AngularJS
MIT License
68 stars 48 forks source link

when angularjs ng-disabled disables a column, calculation is wrong #16

Closed zualexander closed 10 years ago

zualexander commented 10 years ago

hello,

calculation of fixedheader is wrong, when the th is disabled.

br Alex

alalonde commented 10 years ago

What does it mean to set ng-disabled on a attribute? I don't think that is valid HTML.

zualexander commented 10 years ago

hi,

sorry i have meant the ng-hide attribute. if this expression is wrong and the is in fact of that hidden, the calculation is incorrect.

br alex

Am 05.10.2014 um 19:25 schrieb Alec LaLonde notifications@github.com:

What does it mean to set ng-disabled on a

attribute? I don't think that is valid HTML. — Reply to this email directly or view it on GitHub.

Mit freundlichen Grüßen, Alexander Zulechner

alalonde commented 10 years ago

This will be a difficult fix, as the headers are re-rendered only on demand, and we don't have access to the scope from which the ng-show/hide is evaluated. The best I could come up with is an "renderScrollableTable" event which should be broadcasted from your main scope using $scope.$emit.

See the demo for an example.

zualexander commented 10 years ago

Hi,

I think better possibility would be in the fixeheaderfunction where the th-inner divs were created you could use at the "for each th" :visible and check if it is it shown?

Br

Am 05.10.2014 um 23:58 schrieb Alec LaLonde notifications@github.com:

This will be a difficult fix, as the headers are re-rendered only on demand, and we don't have access to the scope from which the ng-show/hide is evaluated. The best I could come up with is an "renderScrollableTable" event which should be broadcasted from your main scope using $scope.$emit

— Reply to this email directly or view it on GitHub.

alalonde commented 10 years ago

That is a fine solution for the initial rendering of the table, but if a column is later shown or hide, the table doesn't get re-rendered. Hence the new event support. The :visible flag is actually in the latest commit, check it out.