kamilkp / angular-vs-repeat

Virtual Scroll for AngularJS ngRepeat directive
http://kamilkp.github.io/angular-vs-repeat/
MIT License
818 stars 228 forks source link

Can't set <td> width of table #163

Open rahalrsh opened 7 years ago

rahalrsh commented 7 years ago
<tbody vs-repeat vs-scroll-parent=".repeater-container">
  <tr ng-repeat="item in items">
    <td class="c1">{{item.id}}</td>
    <td class="c2">{{item.name}}</td>
  </tr>
</tbody>

I have a table like this and I want to dynamically change the width of the elements by modifying the vsRepeat directive. (my goal is to let the user decide the width of the elements/colums) For now inside the vsRepeat directive i'm trying to hardcode the width to 100px by adding the following code inside the updateInnerCollection() function (im only testing my code for now).

   var c1 = $('.c1');
   angular.element(c1).css({'width': (100+'px')});

Now when I check the elements in my console, i see the width is attached as following

   <td class="c1 ng-binding" style="width: 100px;">0</td>

but still my elements are rendered with the original width.

why did the width change but the element not re-rendered? Is this a bug or am i doing something wrong?

Corahe commented 6 years ago

I have the same issue. is there any solution for this?