scrollto time and initial hidden ressource

Ask for help related to our Calendar 2.x version
Post Reply
User avatar
brigot
Posts: 14
Joined: Mon Mar 28, 2011 4:40 pm

scrollto time and initial hidden ressource

Post by brigot » Tue Jan 14, 2020 11:54 am

Hi,

My company having acquired the license for the calendar, I've gotten into it and I already like... but I do have a few questions:

1. how to scroll in day or week mode on a given time ? basically to center the view on the current time ( if all day cant be show ).
2. how to show or hide resources at initialization ? I have 20 resources, but 10 are secondary and therefore the user does not see them by default to lighten the visualization.

and slightly less important issues:

3. in french, the label 'all day' in day/week mode is put on 2 lines, how to enlarge in height this zone ?
4. is there a way to display a "resourceTimeRanges" as on the scheduler ?

Thanks :)

User avatar
saki
Core Developer
Core Developer
Posts: 308
Joined: Thu Mar 30, 2017 9:32 am

Re: scrollto time and initial hidden ressource

Post by saki » Wed Jan 15, 2020 2:49 pm

  1. scrollToDate or scrollToDateCentered should do the job. Mind please that you have to call these methods on the view, not on the main calendar panel
  2. you could use a filter on the resource store
  3. probably some css adjustments but we would need to see it
  4. it's not very clear what you need. Do you have a sketch or screenshot?

User avatar
brigot
Posts: 14
Joined: Mon Mar 28, 2011 4:40 pm

Re: scrollto time and initial hidden ressource

Post by brigot » Wed Jan 15, 2020 5:21 pm

thanks for your answer

1: ok, I thought there was a generic way not depending on which mode I was on.

2 : yes and no, in fact, if I use a filter, it hides the resources, but this is not what I want, I would like the same behavior as if the user had clicked on the checkbox, so still available but not displayed in calendar, but stay in my 'calendarresourcefilter'

4 : in this example
https://www.bryntum.com/examples/scheduler-for-extjs/kitchensink/#examples/resourcezones
the objective is to show the disponibility for this day with a background color

User avatar
saki
Core Developer
Core Developer
Posts: 308
Joined: Thu Mar 30, 2017 9:32 am

Re: scrollto time and initial hidden ressource

Post by saki » Thu Jan 16, 2020 10:23 am

2. In this case you can hide the unwanted resources by a conditionally added css class that would make them invisible. A simple custom renderer could also consume the class returned in data and add it conditionally if a flag in data would be set.

User avatar
brigot
Posts: 14
Joined: Mon Mar 28, 2011 4:40 pm

Re: scrollto time and initial hidden ressource

Post by brigot » Thu Jan 16, 2020 4:52 pm

thanks for help, i have found an other solution for the point 2, call when ready :

Code: Select all

		var checked_selection = {};
		this.resource_store.each(function(rec)
		{
			checked_selection[ rec.get('id') ] = !rec.get('hidden');			
		});	
		Ext.getCmp(this.resourcefilter_id).setValue(checked_selection);

for 4, that's not possible yet, right?


i have an other question :)
i have do this on my calendar panel :

Code: Select all

,eventRenderer : function (event, resource, metaData) 
{
	//console.info('eventRenderer', event, resource, metaData );	
	return '<span data-qtip="'+event.get('tooltip')+'" >'+event.get('title')+'</span>';
}

but with this solution, my tip is show only on the text title. How can i attach it on his dom parent ? ( div with cal-event class )

Thanks :)

Post Reply