1. #1
    Sencha User
    Join Date
    Jul 2014
    Posts
    1
    Vote Rating
    0
    premier_la is on a distinguished road

      0  

    Default Unanswered: Event capture in MVC for datefield defined in the grid toolbar

    Unanswered: Event capture in MVC for datefield defined in the grid toolbar


    Using the MVC pattern how should I trap the event triggered in the Controller when the datefield is clicked.
    This how the grid is, it has a docket item datefield.

    Ext.define('App.view.admin.calendar.CalendarGrid' ,{
    extend:'Ext.grid.Panel',
    alias:'widget.admin-cal.calendargrid',
    requires: [
    'Ext.grid.plugin.RowEditing',
    ]
    itemId: 'calenderGrid',
    autoScroll:true,

    initComponent: function() {

    selType: 'rowmodel',
    plugins: [
    {
    ptype: 'rowediting',
    clicksToEdit: 2
    }
    ],
    columns: {
    defaults: {},
    items: [
    {
    text: 'Date',
    xtype:'datecolumn',
    dataIndex: 'dateIn',
    renderer: Ext.util.Format.dateRenderer('Y-m-d'),
    flex: .2
    },
    {
    text: 'Weekday',
    dataIndex: 'weekDay',
    editor: {
    xtype: 'textfield',
    allowBlank: false
    },
    flex: .5
    },
    {
    text: 'On-Call',
    dataIndex: 'onCall',
    editor: {
    xtype: 'textfield',
    allowBlank: false
    },
    flex: .5
    },
    {
    text: 'On-Duty',
    dataIndex: 'onDuty',
    editor: {
    xtype: 'textfield',
    allowBlank: false
    },
    flex: .5
    }
    ]
    },
    dockedItems: [
    {
    xtype: 'toolbar',
    dock: 'top',
    ui: 'footer',
    items: [
    {
    xtype: 'datefield',
    anchor: '100%',
    itemId: 'dateCal',
    name: 'Filter',
    fieldLabel: 'Filter',
    format: 'F Y',
    value: new Date()
    }
    ]
    }

    ]
    });
    this.callParent( arguments );
    }
    });

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,084
    Answers
    675
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      1  

    Default


    Something like this in your controller:

    Code:
    init : function () {
        var me = this;
    
        me.control({
            'admin-cal.calendargrid datefield[itemId=dateCal]' : {
        });
    }

Thread Participants: 1