Hi,
I'm trying to setup a table with both paging and filtering using rows that have properties that are observables, but I haven't been able to find a way to do it as yet.
I've seen the JSFiddle provided in some other threads (link is https://jsfiddle.net/yxg47s1u/71/ ), but that was quite a while ago and thought there is probably a better way to do it in version 8.
Using the code below I can get the table working with paging and can edit the observable properties on the rows.
If I change it to use the ListDataProviderView from the table filtering example in the cookbook, I can get filtering working but I have to make all row properties standard properties (not observables, as the filterCriterion doesn't work with observables it seems) but then I don't have paging.
Is there some "out of the box" functionality that allows me to do both paging and filtering (if possible with observable properties)?
Provider setup in the JS file
// Base observable array to store the rows
self.dealItemsArray = ko.observableArray();
// Array data provider that wraps the observable array
self.dealItemsProvider = new ArrayDataProvider(self.dealItemsArray, { keyAttribute: 'item' });
// Paging data provider for the array data provider
self.pagingDataProvider = new PagingDataProviderView(self.dealItemsProvider);
Table setup in the html file
<oj-table id="itemTable" class="oj-flex-item" display="grid" columns.width="70" data="[[pagingDataProvider]]"
columns="[[itemTableColumns]]">
<oj-paging-control id="paging" data="[[pagingDataProvider]]" page-size="10" style="margin-top: 5px;"
slot="bottom">
</oj-paging-control>
</oj-table>
I can provide more details if required, but there should probably be some standard way of getting both paging and filtering working on a table.
Thanks,
Daniel