Discuss anything related to web development but no technical support questions


Post by mfrancia »

hi

im using the plugin eventeditor, what i need is to customize the header i only need to show the hour spinner, i tried making these changes
 items : [
//                    this.startDateField = new Ext.ux.form.DateTime({
//                        name : 'StartDate',
//                        x:10,
//                        y:7,
//                        width:160,
//                        timeFormat:this.timeFormat,
//                        timeWidth : 60,
//                        timeConfig: this.timeConfig,
//                        dateFormat:this.dateFormat,
//                        dateConfig: {
//                             allowBlank:false
//                        }
//                    }),
//                    ,
                    
                    new Ext.form.Label({
                        y:1,
                        x:5,
                        xtype : 'label',
                        text : 'Time Off Editor'
                    })
                    ,
                    new Ext.form.Label({
                        y:7,
                        x:110,
                        xtype : 'label',
                        text : 'Hour:'
                    })
                    ,
                    this.durationField = new Ext.ux.form.SpinnerField({
                        x:150,
                        y:7,
                        width:55,
                        allowBlank: false,
                        minValue: 1,
                        maxValue: 24,
                        allowDecimals: false,
                        incrementValue: 1,
                        alternateIncrementValue: 1,
                        accelerate: true
                    })
                ]
but give me an error on the save event of the editor, is this possible or i missed something

thanks

Post by mats »

Yeah you cannot just change the source like that and expect it to work :). I suggest you create a brand new plugin, and use the EventEditor as inspiration. This will lead to a lot cleaner code, than trying to customize the existing EventEditor plugin. In your new plugin, you should delete any fields that are not used (such as date picker etc, if you only need the hour spinner).

Post by mfrancia »

ok

is there any other choice, im thinking this may take a long time maybe set the visibility or display what i want to show with set some properties.

or maybe hide all the header and so ill put the spinner as another control like checkbox and combo

thanks

Post by mats »

If you just want to hide those fields, try this:
.sch-eventeditor .ux-datetime-date,
.sch-eventeditor .ux-datetime-time
{
    display:none;
}

Post by mfrancia »

ok

this is perfect, but the align of the spinner? i need it centered in the header. it is possible to cutomize the editor now adding another label?

thanks

Post by mats »

I think you'll find, that if you open and read the plugin file you'll understand the code very easily. It's a very small file, so should be trivial to accomplish the result you want. Good luck :)

Post Reply