Mootools periodical request

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
shile
Forum Newbie
Posts: 15
Joined: Thu Oct 04, 2012 6:45 pm

Mootools periodical request

Post by shile »

I am using mootools periodical request to refresh a div that contains a calendar which has appointments,my refresh happens every 3 seconds but my problem is that when the refresh occurs my selected row of the calendar goes back to its default value...how can i preserve selected date after refresh?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Mootools periodical request

Post by Christopher »

Can you post a code snippet that demonstrates the problem. Preferably code that we can run.
(#10850)
shile
Forum Newbie
Posts: 15
Joined: Thu Oct 04, 2012 6:45 pm

Re: Mootools periodical request

Post by shile »

this is my code for refreshing the calendar...

Code: Select all

var request = new Request({
  url: '/index.php/teren?view=picker&tmpl=component&format=raw&id=2&y=2013&m=1&d=7',
  method: 'post',
  update: 'Kalendar',
  onComplete: function(response) {
    $('Kalendar').set('html',response);
  }
})

var doMany = function() {
  request.send();
};

doMany.periodical(3000);
the calendar is actually a joomla component and it uses this code to go through dates...

Code: Select all

	function ajaxPicker( $id,$y,$m,$d ) {
		if ($id == 0) { $('ajaxCalendar').innerHTML=''; }
		else {
			new Request({
			  url: '/index.php/teren?view=picker&tmpl=component&format=raw',
			method: 'get',
			data: {id:$id,y:$y,m:$m,d:$d},
			  onSuccess: function(html){
			    $('ajaxCalendar').set('html', html);
			  }
			}).send();


		}
	}
Last edited by Weirdan on Wed Jan 09, 2013 1:46 pm, edited 1 time in total.
Reason: syntax highlighting
Post Reply