C
C#14mo ago
batsky

❔ How to store JS selection data after page refresh

Hello I hope someone can take a look at that, I'm still stuck at that problem https://stackoverflow.com/questions/77367216/how-to-store-js-selection-data-after-page-refresh
Stack Overflow
How to store JS selection data after page refresh
I am trying to create an ecommerce page. I want to make category selections with using checkboxes. It can make the filtering and give me the necessary data; the backend works. But when I change the...
11 Replies
JakenVeina
JakenVeina14mo ago
local storage
batsky
batskyOP14mo ago
I already used local storage, you can check the provided answer in the post. But not working fine with pagination
JakenVeina
JakenVeina14mo ago
What's not working about it?
batsky
batskyOP14mo ago
Check the answer, about using local storage "It is kind of working, but not fully. If I move to another page with pagination, it does not put the data for that page. The initial data is constantly displayed on other pages. Always the first six data are displayed for each page. I can't see the rest of the data. Before the local storage, it was working without problems. It pops up the rest of the data without the filtering than displays the filtered first six data again. I couldn't fix the problem"
JakenVeina
JakenVeina14mo ago
Always the first six data are displayed for each page.
Why is this?
Accord
Accord13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
batsky
batskyOP13mo ago
I am the one who asked man 😄
JakenVeina
JakenVeina13mo ago
and now I'm asking you you expect me to know? you wrote the code, and haven't shown any of it
batsky
batskyOP13mo ago
What do you want me to show? Everything is written in the post in a detailed way, I already explained. If I need to give an example to make sure you understand better. You have 10 item in your data, you display 6 for each, when you change to page two you need to see the rest of 4 data. My problem occures here, I don't see the rest 4 data. I see the first 6 again in everypage. I see the rest 4 data(for a sec) , then I see the first 6 data immidiatly. But I already explained these in the post
JakenVeina
JakenVeina13mo ago
none of the code you put in that post includes you using local storage based on this, I would have to recommend that you get rid of the code that is causing the first 6 results to be included within every page, or modify it in such a way that it only runs for the first page
batsky
batskyOP13mo ago
I already said "based on the answer in the post". Check the answer, I said I used it. But for further advices I didn't edit with using it wow I solved the problem thanks to stackoverflow participations. Have a nice day.
Want results from more Discord servers?
Add your server