dhx.ready and jquery mobile

Hi, I’m working on a small mobile web app based on jquery mobile.
As I can see, when I load the scheduler from another view, it’s not rendered, until I put a setTimeout() that let dhx.ready be triggered when it is available.

<script type="text/javascript">
		
		$('[data-role="page"]').one('pageshow', function() {
			dhx.Touch.enable()
			setTimeout(function(){
				dhx.ready(function(){

				
				scheduler.config.readonly = true;
				scheduler.config.init_date = new Date(2012,8,9);
				//the method allows you to hide the address bar on iPhone/iPod to save the space for application
			    dhx.ui.fullScreen();
			    //object constructor
			    
			    dhx.ui({
			    	container: "schedulerDiv",
			        view: "scheduler",
					id: "scheduler"
			    });
			    
			    $$("scheduler").parse([
					{ id:1, start_date:"2012-9-9 6:00", end_date:"2012-9-9 12:00", text:"Marisa Somerselder",color:"#00cccc"},
					{ id:2, start_date:"2012-9-9 6:00", end_date:"2012-9-9 8:00", text:"Jennifer Braningan",color:"#ffeeff"}
				],"json");
				$$("scheduler").$$("buttons").setValue("month");
			});

			},1000);

		})
	</script>

I’m quite sure that exists a way to integrate the jqm pageshow event and the dhx.ready but I can’t figure how, so I’m asking for some kind help. Thank you.
Matteo

In moment when scheduler’s init called the related container must be already rendered.
I’m not quite sure about jQuery mobile events, but if pageshow event occurs before actual page rendering - setTimeout really can solve problem, as it delays moment of rendering

Try to change setTimeout delay to 1ms - if it still works - problem is in moment of pageshow and not existing container for sure.