maxwroc / HideSeek-Mod

Extended version of original HideSeek plugin
http://maxwroc.github.io/HideSeek-Mod
Apache License 2.0
3 stars 0 forks source link

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

Open twarrdy opened 4 years ago

twarrdy commented 4 years ago

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 commented 4 years ago

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: https://github.com/vdw/HideSeek/pull/40

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

Thanks for suggestion

twarrdy commented 3 years ago

Any updates coming in the near future? Thanks.

maxwroc commented 3 years ago

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

twarrdy commented 3 years ago

Any updates coming soon?

maxwroc commented 3 years ago

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?