Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh Containers postEvent needs to pass in a data parameter #11

Open
sunfmin opened this issue Oct 28, 2016 · 3 comments
Open

Refresh Containers postEvent needs to pass in a data parameter #11

sunfmin opened this issue Oct 28, 2016 · 3 comments

Comments

@sunfmin
Copy link
Contributor

sunfmin commented Oct 28, 2016

For example

  1. FilterOptions container
  2. FilteredProducts container
  • One option: In FilterOptions container if It will post search data to a handler, and the handler did the search, but there is no way to pass that products data into FilteredProducts containers. because refresh those containers is a second request
    • We could store those products somewhere globally like in a database. then when to clear those data is problematic
  • Another Option: postEvent("product_searched", paramObject), then refresh containers will pass the paramsObject to the FilteredProducts container, In the containers, It do the search logic and render products.
@sunfmin
Copy link
Contributor Author

sunfmin commented Oct 28, 2016

After some thoughts, the paramObject needs to be pass into containers as url of the page, because we want to change the url of the search even if we only refresh one container of the whole page. that PJAX? https://github.com/defunkt/jquery-pjax

@sunfmin
Copy link
Contributor Author

sunfmin commented Oct 28, 2016

maybe I should try to implement the FilterOptions first in React in a Container, to see what do we need.

@bodhi
Copy link
Member

bodhi commented Oct 28, 2016

Change the URL using JS history to include the search query, and then post the event? When the containers are reloaded, the query will be included, and then the results container will have access to the query.

@bodhi bodhi mentioned this issue Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants