question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filter + MobX - MeteorJS

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AllenFangcommented, Aug 21, 2018

https://github.com/react-bootstrap-table/react-bootstrap-table2/issues/360

It’s a known issue but little hard to fixed, so currently, I will suggest to do not use react-bootstrap-table2-overlay particular in remote mode, instead you can custom the overlay via noDataIndication

Following is just a live demo.

I will try to fixed this issue if I can. Thank

0reactions
josefheldcommented, Aug 20, 2018

yes, that solved it. Thank you. But why?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Combine MobX and Tracker (createContainer) - help - Meteor forums
Hey guys, I'm trying to pass an observable (MobX) to my data container (Meteor). ... and get filtered data from server. also I...
Read more >
mobxjs/mobx - Gitter
oh … I was looking for something that still inside my observable object :( base on the above example, when filters is updated...
Read more >
Adventures with React, Mobx, and Meteor | by Tom Swales
I have been working with React and Meteor for the past six or seven ... a chance to experiment with the combination of...
Read more >
4.15.7 - mobx - npm
MobX is a battle tested, simple and scalable state management library transparently applying functional reactive programming (TFRP). The Mobx ...
Read more >
mobX - Filter countries in react native? - Stack Overflow
I saw a few possible problems, so I slightly changed the approach. Working example. UPDATED Working example. Note this is untested in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found