Request new features or modifications


Post by vivekBadola »

Hi,
I am using Ext Scheduler and I want to group the resources in vertical mode.
As your Ext Scheduler Kitnchen Sink Example has grouping with horizontal mode.
Please help me to achieve this.
Thanks,

Post by Maxim Gorkovsky »

Hello.
Here is a simple snippet that allows to create nested columns in vertical view, that will group resources by length of the resource name:
Ext.define(null, {
  override: 'Sch.panel.SchedulerGrid',
  createResourceColumns : function (colWidth) {
        var groupsMap = {}, groups = [];

        Ext.Array.each(this.resourceStore.getRange(), function (resource) {
            var col = {
                xclass   : this.resourceColumnClass,
                renderer : this.mainRenderer,
                scope    : this,
                width    : colWidth || 100,
                text     : resource.getName(),
                model    : resource
            };

            var length = resource.getName().length;

            if (groupsMap[length]) {
                groupsMap[length].columns.push(col);
            } else {
                groups.push(groupsMap[length] = {
                    text  : length,
                    columns : [col]
                });
            }
        }, this);

        return groups;
    }
});

Post Reply