Discuss anything related to web development but no technical support questions


Post by Pooja Jain »

I have created a new view by the following code:
 var HalfYear = {
        displayDateFormat: 'Y-m-d',
        shiftIncrement: 1,
        shiftUnit: "YEAR",
        timeColumnWidth: 60,
        timeResolution: {
        unit: "MONTH",
            increment: 1
        },
        headerConfig: {

            middle: {
            unit: "QUARTER",
                 increment: 2,
                renderer: function(start, end, headerConfig, index) {
                   
                    var quarter = Math.floor(start.getMonth() / 6) + 1;
                     return Ext.String.format('Q{0} ', quarter);
                   
                }
            },
            
            top: {
                unit: "YEAR",
             
                renderer: function(start, end, cfg) {
                  
                    return Ext.String.format('{0} ', start.getFullYear());
                }
            }
        }
    };
but when I use ZoomToFit option then it gives error on below line o gnt-all-debug.js file:
var currLevel = Math.floor(this.getCurrentZoomLevelIndex()),
// increment to get next zoom level (-1 for zoom out and +1 - for zoom in)
inc = width / ticks.length < this.zoomLevels[currLevel].width ? -1 : 1,

When I debug the code then currLevel is -1.

How to set value for zoom in the above custom view?

Post by mats »

If you need help, please post in the Help forums.

Please also provide us a clear test case that we can run. Use one of our existing samples and modify, then upload it or build a simple test case in Fiesta. https://fiestadev.bryntum.com/

Post by Pooja Jain »

I have modified the advanced sample for your refernce.In this sample there is half year view added.

Once you click on 'half year view' and then select 'Zoom to fit' option then error is displyed in console(attached screen shot).

Thanks in advance.Waiting for valuable solution.
Attachments
advanced.zip
(17.57 KiB) Downloaded 165 times
problemwithHalfview.png
problemwithHalfview.png (112.96 KiB) Viewed 1851 times

Post by nickolay »

Thanks for the report, the exception has been fixed in our sources, fix will be available in the tomorrow nightly build. However it will not work as you expect - zooming will change the viewpreset to the first preset that fits the given timespan. It will not keep the currently selected viewpreset.

Post Reply