Page 1 of 1

Mootools periodical request

Posted: Tue Jan 08, 2013 10:01 am
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?

Re: Mootools periodical request

Posted: Tue Jan 08, 2013 5:34 pm
by Christopher
Can you post a code snippet that demonstrates the problem. Preferably code that we can run.

Re: Mootools periodical request

Posted: Wed Jan 09, 2013 5:15 am
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();


		}
	}