Two Gridviews

Hello,

I’m trying to format a scheduler to show two grid views, one for the month and another for the day. We use the scheduler as a sign out sheet for our employees. I am able to get it to render if it is the default grid to load however when I try to click on the “Day Report” button it does not work it just goes to the Month view. Am I missing something?

Here is a screenshot and some code

						scheduler.locale.labels.grid_tab = "Month";
					
						scheduler.createGridView({
						   name:"grid",
						   fields:[     // defines columns of the grid
								 {id:"date", label:'Date', sort:'date', width:300, align:"left"},
								 {id:"employee",   label:'Employee',   sort:'str',  width:400, align: "*"},
								 {id:"room_description", label:'Destination', sort:'str',  width:600, align:'left'}
						   ],
							paging:true,
							unit:"month",
							step:1
											


											
					});
					
					
						scheduler.locale.labels.grid_tab2 = "Day Report";	
					scheduler.createGridView({
						   name:"day_grid",
						   fields:[     // defines columns of the grid
								 {id:"date", label:'Date', sort:'date', width:300, align:"left"},
								 {id:"employee",   label:'Employee',   sort:'str',  width:400, align: "*"},
								 {id:"room_description", label:'Destination', sort:'str',  width:600, align:'left'}
						   ],
							paging:true,
							unit:"day",
							step:1
												   
					});


Hi,

I might be able to provide you with some help.

Looking at your code, it seems like you might not be referencing the correct name. Make sure to do the following:

scheduler.locale.labels.grid_tab = "Grid";

scheduler.createGridView({
  name:"grid",
  ...
  ...
});

…and in your html:

<div class="dhx_cal_tab" name="grid_tab"></div>

Notice the name in the declaration, in the labels, and finally in the div declaration.

The name you define in grid view declaration should match it in the labels and the in the div tab in the format of {nameOfGrid}_tab. In your sample code, you used “grid_tab2”, but it isn’t the name you defined your day grid.

Try the following for the day grid:

scheduler.locale.labels.day_grid_tab = "Day Report";

scheduler.createGridView({
  name:"day_grid",
  ...
  ...
});

…and in your html:

<div class="dhx_cal_tab" name="day_grid_tab"></div>

Hope that helps!

Thanks that helped! I’m not sure how I managed to miss that, perhaps I got over zealous with editing the code and missed that piece.