修改Ext.form.DateField:
  1. onTriggerClick : function(){
  2. if(this.disabled){
  3. return;
  4. }
  5. if(this.menu == null){
  6. this.menu = new Ext.menu.DateMenu();
  7. }
  8. Ext.apply(this.menu.picker, {
  9. minDate : this.minValue,
  10. maxDate : this.maxValue,
  11. disabledDatesRE : this.ddMatch,
  12. disabledDatesText : this.disabledDatesText,
  13. disabledDays : this.disabledDays,
  14. disabledDaysText : this.disabledDaysText,
  15. format : this.format,
  16. minText : String.format(this.minText, this.formatDate(this.minValue)),
  17. maxText : String.format(this.maxText, this.formatDate(this.maxValue)),
  18. input: this//davi
  19. });
  20. this.menu.on(Ext.apply({}, this.menuListeners, {
  21. scope:this
  22. }));

  23. this.menu.picker.setValue(this.getValue() || new Date());
  24. this.menu.show(this.el, "tl-bl?");
  25. }
  26. ...
复制代码
修改Ext.DatePicker:
  1. onRender : function(container, position)...{
  2. //增加id:date_daysdate_bottom 用来隐藏days davi
  3. var m = [
  4. '<table cellspacing="0">',
  5. '<tr><td class="x-date-left"><a href="#" title="', this.prevText ,'">*</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="', this.nextText ,'">*</a></td></tr>',
  6. '<tr id="date_days"><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'];

  7. ...
  8. m[m.length] = '</tr></tbody></table></td></tr><tr id="date_bottom"><td colspan="3" class="x-date-bottom" align="center"></td></tr></table>';
  9. ...
  10. if(Ext.isIE)...{
  11. this.el.repaint();
  12. }
  13. this.update(this.value);
  14. ...
  15. //如果日期格式为Y年m月 则不显示日 davi
  16. if(this.format == 'Y年m月')...{
  17. Ext.get('date_days').hide();
  18. Ext.get('date_bottom').hide();
  19. }
  20. /**//**/
  21. },
  22. update : function(date)...{
  23. ...
  24. for(; i < 42; i++) ...{
  25. textEls[i].innerHTML = (++extraDays);
  26. d.setDate(d.getDate()+1);
  27. cells[i].className = "x-date-nextday";
  28. setCellClass(this, cells[i]);
  29. }

  30. //如果日期格式为Y年m月 则不显示日 davi
  31. if(this.format == 'Y年m月' && this.getValue() != date)...{
  32. this.input.setValue(date);
  33. this.input.fireEvent("select", date, this.input);
  34. }
  35. /**//**/
  36. ...
  37. }
复制代码
用法:
  1. var date = new Ext.form.DateField({
  2. ...
  3. format: 'Y年m月',
  4. ...
  5. });
  6. date.applyTo('date');
  7. date.on('select',function(){...});
复制代码
why my husband cheated on me damske.com my husband cheated on me blog
what causes women to cheat why most women cheat husband watches wife cheat
TOP