Closed rmja closed 8 years ago
I have been going back and forth about how to implement this, and I think I have finally settled. I'm going to provide an API for the au-table element that will expose some methods; one of them will be: revealItem(item). If pagination is enabled it will reveal the page that contains the provided item. The only caveat will be if the item you want to reveal is not visible because of a filter... I'm not sure if I want to have the au-table directly clean the filter... Maybe we can have a second boolean parameter to force the reveal, meaning any filters will be cleared... on any case you could clean the filter yourself.
I hope I get a chance to implement this in the next couple of days.
Sounds fine to me. Maybe, instead of having a second force parameter, revealItem(item) could return a boolean telling weather the item was in fact revealed. If false, then the one can clear the filter and call revealItem(item) again, and tell the user that the filter was cleared.
Yeah, returning a boolean sounds good, thanks for your suggestions.
I have the fix in place, not I need to update the documentation. FYI for the next release I'm renaming the $IsSelected property to $isSelected to adhere to standards.
I have updated the documentation to include the Api
Hi,
I am trying to select the currentPage so that it displays a particular item:
This works perfectly in the simple case, but when column sorting is applied, this of cause selects the wrong page because
this.items
is the unmodified data bound withdata.bind
. Based on https://github.com/tochoromero/aurelia-table/blob/master/src/au-table.js#L78 it would be interresing to somehow have access to localData after filter and sort is applied, but before pagination is applied.