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

An example of table pagination, sorting, and filtering using LiveView #20

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

joerichsen
Copy link
Contributor

table_example

joerichsen and others added 3 commits March 22, 2019 16:40
I had a page with 12 items. When the page size was set to 10, it would only show one page due to the number of rows being divided by the page size then truncating. Adding one 1 the number of rows / page size before truncating should fix the issue.
@chrismccord
Copy link
Owner

Thanks for this! Sorry it has taken me so long t get back, but I have been waiting until we had pushstate support in place for proper url updates so we can be good web citizens with LV. Now that live_link and live_redirect has landed, this PR can make use of it to update the URL bar and refetch the info for pagination and sorting. See my commit here for examples of how it works:

6cb8255

If you can update it to use the latest features, I will gladly merge. Thanks!

@joerichsen
Copy link
Contributor Author

Excellent :-) I will update this PR soon.

@joerichsen
Copy link
Contributor Author

OK, I have tried to update the example with pushstate support now :-)

I works but I am not sure that I handled it the right way so feedback is very welcome :-)

Look at the changes here https://github.com/joerichsen/phoenix_live_view_example/compare/95789dd52c4a15bb0dd2fbee8a97fc2a3781d4b6..65806f02514f36361f9d482de6dd0b6e6bbbcccc

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

Successfully merging this pull request may close these issues.

3 participants