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

Limit number of items to show and add show more button [new feature] #23

Open
twarrdy opened this issue Oct 4, 2020 · 5 comments
Open

Comments

@twarrdy
Copy link

twarrdy commented Oct 4, 2020

This feature will allow users to limit the number of items to show and add a show more button. There’s no AJAX needed for that, just hide with CSS. For example, we have 50 items, and we only want to show 10, then when the user clicks on the show more button, 10 more items are displayed. A counter in the show more button like 'show more 10/50' would be also nice.

See demo:
https://zeshanshani.github.io/simple-load-more/demos/demo.html

@maxwroc
Copy link
Owner

maxwroc commented Oct 6, 2020

TBH I think it would be better to not only do it via CSS but to limit the parsed rows. This will improve perf for big data sets.

Similarly as it is suggested here: vdw#40

I will think about it and will add it once I have a time

Thanks for suggestion

@twarrdy
Copy link
Author

twarrdy commented Nov 17, 2020

Any updates coming in the near future? Thanks.

@maxwroc
Copy link
Owner

maxwroc commented Nov 17, 2020

Sorry, didn't have a time so far. Will try to do it around next weekend

@twarrdy
Copy link
Author

twarrdy commented Feb 17, 2021

Any updates coming soon?

@maxwroc
Copy link
Owner

maxwroc commented Mar 6, 2021

Sorry that it took ages but now I have some time and started thinking about the way to implement it.

The problem with this apprach is that I need to add an element on the page - the more button. I don't want to do it as it will be very problematic and probably it won't work in all the cases (sometimes the list can be inside the table sometimes not).
Additionally I would need to provide an option to change the button text (what if someoen wants an image or some more customization is required?)

I think the best approach would be to allow user to specify ID of the more button and user will have to add it on the page.

So for example the option would be data-more="#more_btn,5" or $(elem).hideseek({ more: "#more_btn,5"})

This will hide #more_btn after initialization and once user starts typing it will show only 5 results and #more_btn (as long there are more results to show).

What do you think?

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