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 .

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...