Jump to content

Recommended Posts

Posted

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; 
 
});
Posted

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.

Posted

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 .

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...