Open jmjf opened 8 years ago
@jmjf thanks for all the interest and yes the first seems like to most straightforward.
The plan is to do a fair bit of refactoring once the Aurelia beta has bedded down a bit - I'd like to make this a half decent grid solution and try to get a decent feature set implemented.
Some of the internals of the templating engine around ViewSlot
and the like have changed so there will likely be some hefty redesigning (I'm flirting with a pluggable model)
Feel free to throw PRs my way if it helps you but bear in mind that I'll probably re-design a chunk of this (I'm also thinking about moving it all to TypeScript)
NOTE: I'm running on the latest (beta-1) skeleton with the skeleton-0.20.0 modifications discussed in Issue #67 and PR #69. I don't think this is related to any of that because this looks like a fairly straightforward issue.
If
pageable == false
, and we aren't using server paging, sorting, or filtering, sorting causes data to disappear.In
handleResult()
,this.cache
is loaded only ifthis.pageable == false
.In
refresh()
, if we aren't using server paging, sorting, or filtering (this.initialLoad
is alwaystrue
, seegetData()
for the only place it's set), we sortthis.cache
. So a non-pageable that isn't using server paging, sorting, or filtering sorts nothing. (Actuallythis.cache
seems to be aModifyArrayObserver
.)Possible solutions:
handleResult()
:this.data = this.cache = result.data
ORrefresh():
both cases setthis.data
and usethis.filterSortPage(this.data)
ORhandleResult()
: replacethis.pageable
withthis.initialLoad
(don't know if this is a legitimate solution, haven't worked through the implications) ORthis.initialLoad = false
(not sure where or how many wheres this might be involved) ORThe first two options seem to be the easiest. The first option seems to be very straightforward and almost certain to work in most (maybe even all) scenarios.
If you have a preference, let me know and I can set up a PR.