Results 1 to 3 of 3

Thread: Util.js & Init.js for Calendar in 6.2.0 EA version has been taken out

  1. #1

    Default Util.js & Init.js for Calendar in 6.2.0 EA version has been taken out

    Hi,

    In the EXTJS 6.2 EA version, to use the calendar we include the 2 js files: build/calender/Util.js & build/calendar/Init.js, and the calendar works fine. However now with the latest version that we have bought the premium license, we noticed that the Util.js & Init.js has been removed from calendar package.

    Since the 2 files been removed, please advise what is the replacement for that? We have tried that without including these 2 files, the calendar could be rendered out, BUT without showing the "Views" (Work Calendar, Personal, etc) at the left panel.

    Please help. Thanks.

  2. #2
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258
    Answers
    759

    Default

    I'm pretty sure that was all centralized into util/Remote.js, however I'm not really clear on why that's causing an issue? It's just a file to generate some sample data, it's not intended to be used outside of this specific case.

  3. #3

    Default

    Hi Evant,I can't find where is this util/Remote.js. I only see the Remote.js under the pivot component, I guess it is not related?Besides, I have tried copy paste the init.js and the entire calendar/build/calander folder from the EA version to the latest version, and then our current page with the calendar is working now, but still with some error when access the "Day" view, it throw js error as per the attached screenshot.calendar-error.PNGcalendar-day.jpgI understand that in the EA version, the Full.js is where the sample data is generated. However all this init.js, full.js, util.js also contain some functions that we need to run the calendar esp. the util.js?Below is our code that render the calendar:JSP~~~
    Code:
            Test ExtJS 6
    JavaScript~~~~~~~~
    Code:
    /** * calendar panel POC */Ext.application({    name : 'Calendar page', // required.        // function to run when page is ready    launch : function() {        loadCalendarAjaxSetup();                var calendar = loadCalendar();        var container = new Ext.Container({            fullscreen: true,            renderTo: Ext.getBody(),            scrollable: true,            items: [                    calendar                    ]        });                // try find an event and click on it, and to observe the console log.        /*var x = calendar.down("calendar-dayview");        x.on('beforeeventedit', function(){            console.log('asdf');        });*/    }});function loadCalendar(){    return new Pavo.CalendarPanel({                width: isMobile? documentWidth : 1200,        height: isMobile? documentHeight - 70: 600,                views: {            day: {                id: 'asdf',                xtype: 'calendar-dayview',                startTime: 6,                endTime: 22,                controlStoreRange: false,                editForm: null,                addForm: null                /*listeners: {                    beforeeventedit : function() {                         console.log('beforeeventedit');                     },                     eventtap : function() {                         console.log('eventtap');                     },                     eventdrop : function() {                         console.log('eventdrop');                     }                 }*/            },            week: {                xtype: 'calendar-week',                controlStoreRange: false,                weight: 15,                dayHeaderFormat: 'D d',                addForm: null            },            //this is custom calendar week view            workweek: {                xtype: 'calendar-week',                controlStoreRange: false,                titleTpl: '{start:date("j M")} - {end:date("j M")}',                label: 'Work Week',                weight: 15,                dayHeaderFormat: 'D d',                firstDayOfWeek: 1,                visibleDays: 5            }        },        timezoneOffset: 0,        store: new Ext.calendar.store.Calendars({            autoLoad: true,            proxy: {                type: 'ajax',                //url: '/KitchenSink/CalendarFull'                url: '/CalendarPanelPocData/myCalendarData'            }        })    });}/** * please refer to the original code:  * "apps/pavo-genie-e-services/pavo-genie-esvcs/apps/target/pavo-genie-esvcs-apps-5.3-SNAPSHOT/html/js/extjs/packages/calendar/build/calendar/Full.js" */function loadCalendarAjaxSetup(){        Ext.define('Pavo.calendarData', {    requires: [               'KitchenSink.data.Init',               'KitchenSink.data.calendar.Util'           ]       }, function() {           /*function halfhour() {               return Math.random() < 0.5 ? 30 : 0;           }           function getRandom(arr) {               var n = N.randomInt(0, arr.length - 1);               return arr[n];           }*/                      function convertDateToUTC(date) {               return Ext.Date.utc(                       date.getFullYear(),                       date.getMonth(),                       date.getDate()               );           }           var U = KitchenSink.data.calendar.Util,               D = Ext.Date,               //N = Ext.Number,               //now = U.utcNow(),               //start = D.subtract(D.subtract(now, D.YEAR, 0), D.DAY, 0),               //end = D.add(D.add(now, D.YEAR, 0), D.DAY, 5),               data = {                   work: (function() {                                              // all the date must added by 8 hours due to timezone                       var data = [{                           title: "terence fung testing",                           startDate: U.setDate(convertDateToUTC(new Date('2016-07-01')), undefined, 9, 30),                           endDate: U.setDate(convertDateToUTC(D.add(new Date('2016-07-01')), D.HOUR, 8), undefined, 10, 30),                           description: "asdfasdfasdf"                       }];                                              return U.generateIds(data, 3000);                   })(),                   personal: (function() {                       var data = [{                           title: "QWERQWER",                           startDate: U.setDate(convertDateToUTC(new Date('2016-07-02')), undefined, 9, 30),                           endDate: U.setDate(convertDateToUTC(D.add(new Date('2016-07-02')), D.HOUR, 8), undefined, 10, 30),                           description: "QWERQWER"                       }];                       return U.generateIds(data, 6000);                   })(),                   projectZeus: (function() {                       var data = [{                           title: "ZCVZCV",                           startDate: U.setDate(convertDateToUTC(new Date('2016-07-03')), undefined, 9, 30),                           endDate: U.setDate(convertDateToUTC(D.add(new Date('2016-07-03')), D.HOUR, 8), undefined, 10, 30),                           description: "ZCVZCV"                       }];                       return U.generateIds(data, 9000);                   })()               }           Ext.ux.ajax.SimManager.register({               '/CalendarPanelPocData/myCalendarData': {                   type: 'json',                   data: [{                       id: 1,                       title: 'Work Calendar',                       eventStore: {                           proxy: {                               type: 'ajax',                               url: '/CalendarPanelPocData/myCalendarData/1'                           }                       }                   }, {                       id: 2,                       title: 'Personal',                       eventStore: {                           proxy: {                               type: 'ajax',                               url: '/CalendarPanelPocData/myCalendarData/2'                           }                       }                   }, {                       id: 3,                       title: 'Project Zeus',                       eventStore: {                           proxy: {                               type: 'ajax',                               url: '/CalendarPanelPocData/myCalendarData/3'                           }                       }                   }]               },               '/CalendarPanelPocData/myCalendarData/1': {                   type: 'json',                   data: function(ctx) {                       return U.generateOutput(data.work, 1, ctx);                   }               },               '/CalendarPanelPocData/myCalendarData/2': {                   type: 'json',                   data: function(ctx) {                       return U.generateOutput(data.personal, 2, ctx);                   }               },               '/CalendarPanelPocData/myCalendarData/3': {                   type: 'json',                   data: function(ctx) {                       return U.generateOutput(data.projectZeus, 3, ctx);                   }               }           });       });}
    Attached Images Attached Images

Similar Threads

  1. Replies: 2
    Last Post: 21 Mar 2017, 6:30 AM
  2. Ext.util.DelayedTask not working in pass code lock mode in ios9.1 version using sench
    By vijayakumar2684 in forum Sencha Architect 2.x: Help & Discussions
    Replies: 1
    Last Post: 23 Dec 2015, 9:57 AM
  3. Replies: 3
    Last Post: 26 Apr 2013, 5:49 AM
  4. [CLOSED] Operation.commitRecords fails, wrong Ext.util.MixedCollection init?
    By Zyphrax in forum Sencha Touch 2.x: Bugs
    Replies: 1
    Last Post: 8 Dec 2011, 12:35 PM
  5. java.util.calendar
    By mariab in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 12 Nov 2010, 2:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •