2012-07-08 25 views

回答

2

这是因为不存在 'monthchange' 事件 '延伸Ext.date.Picker' 的示例:

Ext.define("YourCalendarPicker", { 
    extend: "Ext.picker.Date", 
    ... 
    update : function(date, forceRefresh){ 
     var me = this, 
      monthViewChange = me.isAnotherMonthView(date); 
     me.callParent(arguments); 
     if (monthViewChange){ 
      me.fireEvent("monthviewchange", me, date, me.activeDate); 
     } 
     return me; 
    }, 
    ... 

    /** 
    * return true if the given date is in a different month view of the actual calendar date 
    * @param {Date} date 
    * @return {Boolean} 
    */ 
    isAnotherMonthView: function(date){ 
     var activeDate = this.activeDate || date; 
     return date.getYear() != activeDate.getYear() || date.getMonth() != activeDate.getMonth(); 
    } 
}; 
相关问题