thecodeholic / lobipanel

jQuery plugin for bootstrap panels. It extends panels with several common and useful functions.
MIT License
168 stars 75 forks source link

Is there onReload / beforeReload event? #28

Closed sama55 closed 7 years ago

sama55 commented 7 years ago

I want to refresh panel content with my Ajax process without loadUrl option. Is there event that is triggered when reload button is clicked?

thecodeholic commented 7 years ago

Well, there is no direct callback for this. BUT, after lobipanle is initialized you can select the reload button and attach click listener to it and do whatever you want.

sama55 commented 7 years ago

Thank you for your response. But, can I fetch event on my high level javascript? This is because, probably, I think that lobipanel call stopPropagation() in lobipanel.js. What do you think?

thecodeholic commented 7 years ago

I am almost sure that you will be able to fetch event.

sama55 commented 7 years ago

I tried to fetch event with on("click")" function of the jQuery. But, unfortunately, event did not fire. What about on your environment?

thecodeholic commented 7 years ago

This code works fine for me

$('.lobipanel').eq(0).find('[data-func=reload]').on('click', function(){
    console.log("Works!!!!");
});
sama55 commented 7 years ago

I will try it. Thanks arboshiki!

sama55 commented 7 years ago

I was able to fetch reload event. Thank you so much.