Unit (week) view; column width for specific unit(s)

I think I already know the anser to this :slight_smile: But I wonder if it’s somehow possible to make a specific unit have a certain column width (both in week view and day view)? I want to have a certain unit to be thinner than the rest.

Hi,
you’re right, there is no built-in way to do so:)
Although, you can define a proxy for the inner method that calculates the width for each column - “scheduler._calc_scale_sizes
github.com/DHTMLX/scheduler/blo … r.js#L2806
github.com/DHTMLX/scheduler/blo … r.js#L2833
The method is called by day/week/units and month views, so inside a wrapper you may want to add a checking for currently active view and amend calculation for a units view only:

(function(){ var scaleSizes = scheduler._calc_scale_sizes = function(width, from, to){ scheduler._calc_scale_sizes = function(width, from, to){ if(scheduler.getState().mode != "your units view"){ // if one of default views - call the default logic return scaleSizes.apply(this, arguments); }else{ // do some custom calculations otherwise } } });

Calculated sizes are stored in inner object scheduler._colsS, which have some custom properties and numeric indexes. Values of numeric properties define widths of columns in calendar layout.
I.e. scheduler._colsS[n] holds a width of n-th column from left to right, n >= 0. In multiday units view indexes will go from 0 to (number of days * number of units)

Great! I’ll look at that.