Discuss anything related to web development but no technical support questions


Post by julia »

Hi! Could you please help me with column WBS, i added it, but it shows numbers like 1,2,3 ,4 ...etc, but not 1.1.1, 1.1.2, 2, 2,1.. etc. I added to my GanttPanel config:
requires: [ 'Gnt.selection.SpreadsheetModel' ] ,
 selModel : {
                    type : 'spreadsheet',
                    width : 100
                 },
Image WBS

Also i need to hide this column by default, but dont'n know how.
Thanks.

Post by mats »

Sure, just use the Bryntum spreadsheet instead which uses WBS by default:
selModel : {
        type : 'gantt_spreadsheet'
    },

Post by julia »

Thank you!! It works) But could you help me please with one more question: how to change visability of this column by default (user must have ability to hide and show it), it width? Should i add column or not? This code doesn't works:
selModel : {
                    type : 'gantt_spreadsheet',
                    width : 100, 
                    hidden : false
                 },

Post by pmiklashevich »

Hello Julia,

It's not configurable out of the box, but you can extend it and make it configurable. This is an example of how to do it:
Ext.define('MySelModel', {
    extend : 'Gnt.selection.SpreadsheetModel',
    alias  : 'selection.myselmodel',

    wbsColumnConfig : null,

    privates : {
        getNumbererColumnConfig : function () {
            return Ext.apply(this.callParent(arguments), this.wbsColumnConfig);
        }
    }
});

Ext.define('Gnt.examples.advanced.view.Gantt', {
    extend : 'Gnt.panel.Gantt',
    xtype  : 'advanced-gantt',

    selModel : {
        type            : 'myselmodel',
        wbsColumnConfig : {
            text     : 'test',
            width    : 100,
            hideable : true,
            hidden   : true
        }
    },
Best wishes,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post by piyush37 »

Really helpful information. Many thanks for sharing this.

Post by pmiklashevich »

I've added wbsColumnConfig to the Gnt.selection.SpreadsheetModel, so after next release you won't be needed to override of getNumbererColumnConfig function. Please keep in mind that since the selection model is private the config is private as well.

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply