Question

I have a afterrender event which should be called on my datefield in my formpanel. however, it looks like it won't render, and so the afterrender event doesn't work. any ideas why?

here's my code:

    this.activityFormPanelEdit = Ext.create('Ext.form.FormPanel', {
        xtype: 'form',
        autoRender: true,
        layout: {
            align: 'stretch',
            type: 'vbox'
        },
        header: false,
        pollForChanges: false,
        items: [{
            xtype: 'form',
            layout: {
                align: 'stretch',
                type: 'hbox'
            },
            items: [
                {
                    xtype: 'datefield',
                    name: 'reminderDate',
                    itemId: 'reminderDate',
                    fieldLabel: 'Erinnerung am',
                    padding: '10',
                    style: 'background-color: red',
                    disabled: true,
                    listener: {
                        afterrender: function (c) {
                            c.inputEl.on('dblclick', function () {
                                c.setValue(new Date());
                            });
                        }
                    }
                }]
        }]
Was it helpful?

Solution

You have a typo in your code.

Name of config property where you can define event handlers is listeners not listener

http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.Component-cfg-listeners

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top