Support for v6.x of our Scheduling components

Post by Arno Voerman »

I have a project with a project calendar and I want to remove the calendar and adjust the default (27/7) calendar to all my tasks.

I use the following simple code:

var calMngr =,
ProjNode = calMngr && calMngr.getNodeByCalendar(calMngr.getProjectCalendar());

//If the project calendar-node is found remove it!
ProjNode && ProjNode.remove();

//Adjust the default calendar

but the line "gantt.getTaskStore().adjustToCalendar();" throws an error. The project calendar is still pointing to the original project calendar, which is marked 'destoyed'.

What is the best way to destroy the (custom) project-calendar and adjust the defaults?


Post by arcady »

There must be some project calendar assigned always. The gantt cannot live w/o it. So just removing won't work I think.

I would instead make a new calendar that fits your needs and set it as the project one:

// make some new calendar
var newCalendar = Ext.create('', { Name : 'Foo' });

var cm = Ext.first('ganttpanel').crudManager.getCalendarManager();

// register it in the calendars store
    calendar : newCalendar,
    leaf     : true

// make the calendar the project one

After assigning a new calendar it will automatically realign tasks no need to call adjustToCalendar.
And you can remove the old calendar too.

Post by Arno Voerman »

OK. this helps. I just hoped the standard calendar was automatically added.


Post Reply