Blesta Addons Posted December 28, 2014 Report Posted December 28, 2014 i want to reload the tab contents of my module with ajax , but is not working .i have added the class "ajax" to my link , no result .let say i have tabStats , i want to add a button inside this tab , when clicked the content of this tab reloaded via ajax .any tips to achieve this ? EDIT : ihave arrived to some result , but till something is not working . now i can send the update post via this javascript . but the content is not updated , i s in the dev tools the request is loading the new data . $(".refresh").click(function() { var a = $(this); $(this).blestaRequest("GET", $(this).attr("href"), null, function(data) {}, null, {dataType:"json"}); return false; }); Quote
Max Posted December 30, 2014 Report Posted December 30, 2014 Would just create a big <div> of your own inside your tab. <div id="mycontent">initial content [...]</div> and change that using Ajax with something along the lines of: $.post(document.location.href, {'somepostparameter': 'value'}, function(reply) { document.getElementById("mycontent").innerHtml = reply; }, 'html'); (not tested) Having the <div> of your own, prevents you from having to make assumptions about the Blesta template that includes the tabs. It may change in the future, or it may have been modified by the user if you develop for others. Quote
Blesta Addons Posted December 31, 2014 Author Report Posted December 31, 2014 Thanks max, but i want to get the total output of the tabs , let say i have a tab for getting info of active proccess in the system , i want the tabs to fetch every 10 sec for a new value of the process list . but any way i will try your idea . Quote
Max Posted December 31, 2014 Report Posted December 31, 2014 Note that the <div> can contain subelements and can cover the total tab. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.