correct way to destroy scheduler

Ask for help relating to our Sencha Touch based Scheduler (for iPad, or any other supported phone, phablet or tablet)
User avatar
mats
Core Developer
Core Developer
Posts: 15893
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: correct way to destroy scheduler

Post by mats »

Seems you've encountered this bug, still not fixed by Sencha. http://www.sencha.com/forum/showthread. ... ost1077881

Try settings your 'Draggable' data property to true for events that should be draggable.

Also a lot of things should be cleaned up in your code:

This should be done once, not every time you create a Scheduler (run this code in the "root scope").

Code: Select all

 Sch.preset.Manager.registerPreset("soOperations-0", {
            timeColumnWidth   : 60,
            rowHeight         : 60,
            displayDateFormat : 'G:i',
            shiftIncrement    : 1,
            shiftUnit         : "WEEK",
            timeResolution    : {
                unit      : "MINUTE",
                increment : 1
            },
            defaultSpan       : 26,
            headerConfig      : {
                middle : {
                    unit       : "WEEK",
                    increment  : 1,
                    dateFormat : 'W'
                },
                top    : {
                    unit       : "MONTH",
                    increment  : 1,
                    dateFormat : 'M y'
                }
            }
        });
        Sch.preset.Manager.registerPreset("soOperations-1", {
            timeColumnWidth   : 60,
            rowHeight         : 60,
            displayDateFormat : 'G:i',
            shiftIncrement    : 1,
            shiftUnit         : "MONTH",
            timeResolution    : {
                unit      : "MINUTE",
                increment : 1
            },
            defaultSpan       : 24,
            headerConfig      : {
                middle : {
                    unit       : "MONTH",
                    increment  : 1,
                    dateFormat : 'M'
                },
                top    : {
                    unit       : "YEAR",
                    increment  : 1,
                    dateFormat : 'y'
                }
            }
        });
        Ext.define('Line', {
            extend : 'Ext.data.Model',
            config : {
                fields : [
                    'Date',
                    'Text',
                    'Cls'
                ]
            }
        });
This code is wrong, and doesn't do anything. setStartDate is a method - you're assigning it a value. Not correct.

Code: Select all

rowtap:function( panel, record, rowIndex, simpleGrid, event, eOpts ){
                        var recordFound = eventStore.findRecord('ResourceId',1);
                        recordFound.setStartDate = new Date(2014, 10, 15);
                        eventStore.sync();
                    },
This should be removed unless you have a need for it (assuming you copied it from one of our samples?).

Code: Select all

 sorters : 'StartDate', // Just to keep task list ordered
                    //setup the grouping functionality to group by the first letter of the firstName field
                    grouper : {
                        groupFn : function (record) {
                            var dt = record.getStartDate();
                            return dt && Ext.Date.monthNames[dt.getMonth()];
                        }
                    },
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
pincherhgz
Posts: 78
Joined: Mon Oct 27, 2014 11:40 am

Re: correct way to destroy scheduler

Post by pincherhgz »

thanks for the remarks, we'll clean that code (by the way this is not an element of our app, we just always add elements for your test examples ;) )

User avatar
pincherhgz
Posts: 78
Joined: Mon Oct 27, 2014 11:40 am

Re: correct way to destroy scheduler

Post by pincherhgz »

just to understand your reply, the sencha bug may be the problem that we are facing with the second instantiating of the scheduler and the drag&drop ?

User avatar
mats
Core Developer
Core Developer
Posts: 15893
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: correct way to destroy scheduler

Post by mats »

Yes
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

Post Reply