-
Notifications
You must be signed in to change notification settings - Fork 431
Description
Hi,
I have the following situation:
My container loads data from Meteor backend via a Meteor handleTableChange. When the data arrives I set it to an observed variable. This causes the table to be updated.
My problem is, that the value in the filter box is removed and it is unknown to the user what filter is used.
To get back to the original list, the user can only reload the whole page...
The examples in the story book use setState. But that is irrelevant for my case... My issue also appears when using setState.
What I am wondering is, that as soon as I type a letter, the function handleTableChange is called. I assumed it should only be called after pressing ENTER.
Here's my function handleTableChange:
handleTableChange = (type, {page, sizePerPage, filters, sortField, sortOrder, cellEdit}) => {
this.loading = true; // @observable loading = true;
if (type === 'filter' || type === 'sort' || type === 'pagination') {
Meteor.call('contractors.loadList', type, page, sizePerPage, filters, sortField, sortOrder, cellEdit, (err, res) => {
if (res) {
this.data = res.data; // @observable data = [];
this.listProps = res; // @observable listProps = { page: 1, sizePerPage: 10, totalSize: 0 };
}
this.loading = false;
});
}
};
The server loads data from database, does the sorting, filtering and paginating of the result set.
I hope you can give me some guidance where or if I am doing something wrong.
Thank you,
Josef