Add refresh button to dynamic widget bar content

Hi.

I have a “Wishlist” table component in the top widget bar. It displays all the user’s saved searches. Problem i have is that the user needs to refresh the page to see the latest saved search addition.

Now, my solution was to put a button there saying “Sync Saved” with an href="".

This refreshes page and updates saved searches in widget area no problems. But the issue is that it closes the widget area, so user has to repoen it.

Thats no big deal for us, but will be confusing for them.

Request:

I have seen forum topics where you can use jquery to create a hyperlink anywhere on the page or nav menu that opens a widget area.

Basically, i want that jquery hyperlink to be in the widget area.

Is there a jquery i can put in customizer that when you hit the “Sync Searches” button (inside header widget), it refreshes page then reopens the widget area?

I have added a class for the button…

<a class=“wishlist_reload_button”

Please see screenshot for what i mean.

Thanks in advance for your help.
Max

Hi Max,

Thank you for writing in, while that is outside the scope of support, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here.

Instead of reloading the entire page, why not reload only the #x-widgetbar container, what you need to do is write a function that will be fired when a click event is done on your button (reload link).

https://www.w3schools.com/jsref/event_onclick.asp

You can add custom JavaScript function under Theme Options > JS

You can use the line of code provided here to reload the #x-widgetbar container.

Then add the onclick="myFunction()" property on your button to trigger the function everytime it clicked.

Hope it helps,
Cheers!

I’ts a bit too techie for me. I added this to js.

$("#wishlist_header_widget").load(location.href+" #x-widgetbar>*","");

#wishlist_header_widget is the div of the content in the widgetbar.

Then on widget button i added
Click me

@friech,

As what my colleague said this customization is outside of our support, you may seek help for a 3rd party developer to implement your issues. I hope you understand regarding this matter.

Thank you.

Hello @gimmechefs,

Thanks for updating in! The thread you are referring to has been responded 51/2 years ago. A lot has changed both in the theme and our support. We also have improved the quality of our support. As of this time, any addition or modification of the theme or plugin feature is beyond the scope of our support already. Our support forum only covers getting your site set up, bug fixes, and minor cosmetic changes as long as it is related to the X theme, Pro theme, Cornerstone, and other bundled plugins. If we go back to your original post you have mentioned this:

Basically, i want that jquery hyperlink to be in the widget area.

This statement clearly states an additional features of the widget area. We are unable to provide support for customizations under our Support Policy. If you are unfamiliar with code and resolving potential conflicts, you may select our One or Care service for further assistance. You also have the option to contact a 3rd party developer to do the customizations for you.

We, thank you for your kind understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.