charlespockert / aurelia-bs-grid

Aurelia and Bootstrap powered datagrid control
MIT License
45 stars 21 forks source link

Setting page size on initialization does not work #51

Open jadrake75 opened 8 years ago

jadrake75 commented 8 years ago

If you set page-size="20000" it will still use 10. Unless you debounce a call to a bound variable in your view-model on attached(). example

export class MyTableVM {
         pageSize = 50;

         attached( ) {
              _.debounce(function(self) {
                 self.pageSize = self.pageSize * 1000;
              })(this);
          }
}

The subsequent html looks like

<grid page-size.bind="pageSize">
...
</grid>

in grid.js the page size is being read as 10 and only changes if your change that value after the fact (so your demos work but it not configurable in template)

charlespockert commented 8 years ago

Aware of this - I changed a few things because I was getting two data loads on init - I think I'm using the wrong hook for initialisation, so as a temporary measure I took out the page size change refreshing the grid which causes this issue