1. #131
    Ext User
    Join Date
    Jul 2008
    Posts
    7
    Vote Rating
    0
    sasho is on a distinguished road

      0  

    Default


    Quote Originally Posted by sasho View Post
    Will do, thanks for the tip
    It worked indeed, thanks

    Now, is there a way to get the new value(s) for the month and year, as a result of the occurence of a year or a month-associated event? (for example, afteryearchange or beforeyearchange )

  2. #132
    Sencha User
    Join Date
    Oct 2007
    Location
    Berlin, Germany
    Posts
    891
    Vote Rating
    9
    wm003 will become famous soon enough

      0  

    Default


    Quote Originally Posted by sasho View Post
    Now, is there a way to get the new value(s) for the month and year, as a result of the occurence of a year or a month-associated event? (for example, afteryearchange or beforeyearchange )

    When the month AND Year have changed 2 both events will be fired (monthchange and yearchange) and they deliver the old and new selected values.

    according to the docs of post#1:"beforemonthchange"
    Called with pickerobject, oldStartMonth, newStartMonth

    "aftermonthchange"
    Called with pickerobject, oldStartMonth, newStartMonth

    "beforeyearchange"
    Called with pickerobject, oldStartYear, newStartYear

    "afteryearchange"
    Called with pickerobject, oldStartYear, newStartYear

  3. #133
    Ext User
    Join Date
    Jul 2008
    Posts
    7
    Vote Rating
    0
    sasho is on a distinguished road

      0  

    Default


    Quote Originally Posted by wm003 View Post
    When the month AND Year have changed 2 both events will be fired (monthchange and yearchange) and they deliver the old and new selected values.

    according to the docs of post#1:"beforemonthchange"
    Called with pickerobject, oldStartMonth, newStartMonth

    "aftermonthchange"
    Called with pickerobject, oldStartMonth, newStartMonth

    "beforeyearchange"
    Called with pickerobject, oldStartYear, newStartYear

    "afteryearchange"
    Called with pickerobject, oldStartYear, newStartYear
    Thanks again for your help, the following allows me to retrieve the changed year (or month) value:
    PHP Code:
    ...
    listeners:{
                                    
    'afteryearchange': function(datePickerPlusObj,oldYear,changedYear){
                                                                   
    colsole.log(changedYear);}
                                                              },
    ... 
    If there's a better way, please let me know

  4. #134
    Ext User
    Join Date
    Jun 2008
    Posts
    4
    Vote Rating
    0
    hirenb is on a distinguished road

      0  

    Default Help Needed

    Help Needed


    Hi I am using datepickerplus,

    I am using allowedDates as following:
    allowedDates: [new Date(2008,7,1)] but i want to use for loop inside allowedDates to create multiple dates.

    is there any way to do this thing.

  5. #135
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,008
    Vote Rating
    650
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    You just need to pass it an array.

    Code:
    var d = [];
    for (;;)
       d.push(new Date());
    
    allowedDates: d
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  6. #136
    Ext User
    Join Date
    Jul 2008
    Posts
    7
    Vote Rating
    0
    sasho is on a distinguished road

      0  

    Default


    How can I update the minDate and maxDate attributes for a DateFieldPlus component, based on an event in a ComboBox, for example?

    To illustrate, I have the following in a FieldSet:
    PHP Code:
    items = [new Ext.form.ComboBox({
                                    
    name'datatype',
                                    
    fieldLabel'Product',
                                    
    storedataInfo,
                                    
    valueField'value',
                                    
    displayField:'formText',
                                    
    emptyText:'Select a state...',
                                    
    width:190,
                                    
    mode'local',
                                    
    triggerAction'all',
                                    
    editable'false',
                                    
    lazyRendertrue,
                                    
    value:dataInfo.getAt(0).get('formText'),
                                    
    listeners:{'select':    function(thisSelect,curentRecord{
                                            
    Ext.getCmp('dateField').setMinDate(curentRecord.get('minDate'));
                                            
    Ext.getCmp('dateField').setMaxDate(curentRecord.get('maxDate'));
                                                    }}
                            })
    , new 
    Ext.ux.form.DateFieldPlus({
                            
    fieldLabel'Date',
                            
    name'datestamp',
                            
    id'dateField',
                            
    minValue: new Date('2001/01/01'),
                            
    maxValue: new Date('2009/01/01'),
                            
    width:190
                        
    });] 
    It seems that I cannot access the setMinDate and setMaxDate functions in DatePickerPlus, since I keep getting
    PHP Code:
    Ext.getCmp("dateField").setMinDate is not a function 
    . I realise that 'dateField' is a DateFieldPlus instance, but at the moment I cannot see a way to access its' DatePickerPlus. Any ideas?

  7. #137
    Sencha User
    Join Date
    Oct 2007
    Location
    Berlin, Germany
    Posts
    891
    Vote Rating
    9
    wm003 will become famous soon enough

      0  

    Default


    Quote Originally Posted by sasho View Post
    It seems that I cannot access the setMinDate and setMaxDate functions in DatePickerPlus, since I keep getting
    PHP Code:
    Ext.getCmp("dateField").setMinDate is not a function 
    . I realise that 'dateField' is a DateFieldPlus instance, but at the moment I cannot see a way to access its' DatePickerPlus. Any ideas?
    The methods apply to the underlying pickerobject, not the datefield itself. i agree its a bit annoying. Writing a wrapper for all methods will be a bit oversized.

    Anyway, try this to gain access to the methods:

    PHP Code:
    Ext.getCmp("dateField").menu.picker.setMinDate() 

  8. #138
    Ext User
    Join Date
    Jul 2008
    Posts
    7
    Vote Rating
    0
    sasho is on a distinguished road

      0  

    Default


    Quote Originally Posted by wm003 View Post
    try this to gain acces to the methods:

    PHP Code:
    Ext.getCmp("dateField").menu.picker.setMinDate() 
    This works only if the datepicker has been shown first (ie, the icon next to the date field has been clicked by the user). Even in this case, however, dates prior to the new minDate value are still visible and selectable by the user (ie not grayed out).

    To illustrate, here is the code with which I am testing, using firebug:
    PHP Code:
    Ext.onReady(function(){

        
    Ext.QuickTips.init();
        var 
    exDate = new Ext.ux.form.DateFieldPlus({
                
    fieldLabel'blah',
                
    id'myDateField',
                
    usePickerPlus    true,
                
    renderPrevNextYearButtonstrue,
                            
    xtype'datefieldplus',
                
    disableMonthPicker:true,
                            
    value: new Date(2008330), 
                            
    noOfMonth1,
                    
    minDate: new Date(2001,1,1),    
                    
    maxDate: new Date(2009,1,1),    
                            
    multiSelectionfalse,
                            
    showWeekNumberfalse,
                            
    weekendText'This day is part of a Weekend',
                
    listeners: {'select':function(dp,newDate){Ext.Msg.alert('Status'newDate);}}
                });
        var 
    fs = new Ext.FormPanel({
            
    frametrue,
            
    title:'XML Form',
            
    labelAlign'right',
            
    labelWidth85,
            
    width:340,
            
    waitMsgTargettrue,
        
    collapsibletrue,
        
    resizeabletrue,
            
    items: [
                new 
    Ext.form.FieldSet({
                    
    title'Contact Information',
                    
    autoHeighttrue,
                    
    defaultType'textfield',
                    
    items: [{
                            
    fieldLabel'First Name',
                            
    name'first',
                            
    width:190,
                
    listeners:{'change':function(){console.log('value cnaged');
                
    console.info(exDate);
                
    exDate.menu.picker.setMinDate(new Date(2005,1,6));}}
                        }, {
                            
    fieldLabel'Last Name',
                            
    name'last',
                            
    width:190
                   
    },exDate ]})
            ]
          });    
        
    fs.render('form-ct');
    }); 

  9. #139
    Sencha User
    Join Date
    Oct 2007
    Location
    Berlin, Germany
    Posts
    891
    Vote Rating
    9
    wm003 will become famous soon enough

      0  

    Default


    Quote Originally Posted by sasho View Post
    This works only if the datepicker has been shown first (ie, the icon next to the date field has been clicked by the user).
    ok, then also set the min/maxdate to the datefieldplus config, so it will use the values on first render of the pickerobject:

    PHP Code:
    Ext.getCmp("dateField").maxValue date;
    Ext.getCmp("dateField").minValue date
    Quote Originally Posted by sasho View Post
    however, dates prior to the new minDate value are still visible and selectable by the user (ie not grayed out).
    This is indeed a bug. Thanks for reporting. I will upload the next revision of DatePickerPlus later this week. The reported issue will be fixed then.

  10. #140
    Ext User
    Join Date
    Jul 2008
    Posts
    7
    Vote Rating
    0
    sasho is on a distinguished road

      0  

    Default


    Quote Originally Posted by wm003 View Post
    This is indeed a bug. Thanks for reporting. I will upload the next revision of DatePickerPlus later this week. The reported issue will be fixed then.
    I hope it's easily reproduceable. I really like this extension, since i believe it is exactly what I need for the applcation that I am currently working on--it will really simplify the user experience in my opinion, since users will have to go through less steps for picking a date, using an intuitive compoment.

Thread Participants: 111

  1. galdaka (1 Post)
  2. wehtam (5 Posts)
  3. nassaja-rus (1 Post)
  4. mystix (5 Posts)
  5. ludoo (1 Post)
  6. jsakalos (1 Post)
  7. laluigino (2 Posts)
  8. evant (1 Post)
  9. methodz (1 Post)
  10. stevebla (1 Post)
  11. netnoise (1 Post)
  12. KampfCaspar (1 Post)
  13. carstep (2 Posts)
  14. ZooKeeper (1 Post)
  15. nromanel (6 Posts)
  16. Spirit (1 Post)
  17. yuewah (4 Posts)
  18. chemist458 (3 Posts)
  19. jerrybrown5 (3 Posts)
  20. gtomalesky (5 Posts)
  21. jo2008 (1 Post)
  22. aacraig (7 Posts)
  23. stumpy_uk (2 Posts)
  24. hattia (3 Posts)
  25. lpfLoveExt (1 Post)
  26. thoreking (3 Posts)
  27. markusreimers (1 Post)
  28. sigaref (2 Posts)
  29. andreabat (1 Post)
  30. sanjshah (6 Posts)
  31. mask_hot (4 Posts)
  32. dorgan (1 Post)
  33. bornsilly (1 Post)
  34. Zord (3 Posts)
  35. aaronchiang (1 Post)
  36. skbach (5 Posts)
  37. joenilson (2 Posts)
  38. S1-Gezi (1 Post)
  39. pcsernyik (6 Posts)
  40. vizcano (1 Post)
  41. Richie1985 (2 Posts)
  42. radtad (6 Posts)
  43. tagsum (3 Posts)
  44. Nohcs777 (5 Posts)
  45. lavitsky (1 Post)
  46. Hunyi (1 Post)
  47. brenda (3 Posts)
  48. hp (2 Posts)
  49. Dave.Sanders (4 Posts)
  50. DVSDevise (3 Posts)
  51. moegal (3 Posts)
  52. EzBulka (1 Post)
  53. catapl3xis (2 Posts)
  54. rvrdesigns (2 Posts)
  55. rich02818 (5 Posts)
  56. armandoxxx (2 Posts)
  57. WhiteRussian (4 Posts)
  58. lacco (1 Post)
  59. Ronhead (3 Posts)
  60. Urkman (1 Post)
  61. descheret (3 Posts)
  62. dimitrij.zub (1 Post)
  63. hirenb (1 Post)
  64. sasho (7 Posts)
  65. CR_RedFox (1 Post)
  66. joshuabco (1 Post)
  67. apimio (4 Posts)
  68. sirtimbly (2 Posts)
  69. canxss (2 Posts)
  70. SimoAmi (2 Posts)
  71. wemerson.januario (1 Post)
  72. dubdub (3 Posts)
  73. Naokai (5 Posts)
  74. RuiDC (4 Posts)
  75. dkarlsso (1 Post)
  76. slisbin (1 Post)
  77. Chods (2 Posts)
  78. dkroells (3 Posts)
  79. alvaro1728 (1 Post)
  80. sneema (15 Posts)
  81. AdamLShepherd (2 Posts)
  82. bholyoak (2 Posts)
  83. dtex-lab (1 Post)
  84. EZboy (2 Posts)
  85. burbur (1 Post)
  86. strad84 (2 Posts)
  87. radubrehar (4 Posts)
  88. almotasim (2 Posts)
  89. itheart (1 Post)
  90. fmntf (4 Posts)
  91. Allbus (2 Posts)
  92. sprakash (2 Posts)
  93. sansie (3 Posts)
  94. siebe vos (6 Posts)
  95. gkarmadi (1 Post)
  96. fabads (16 Posts)
  97. kskrumpet (4 Posts)
  98. sivanesan (1 Post)
  99. marco81 (1 Post)
  100. Lobo (2 Posts)
  101. benoitrx (1 Post)
  102. JazzMan88 (3 Posts)
  103. Urzzza (1 Post)
  104. josefhaydn (2 Posts)
  105. eja40 (3 Posts)
  106. lukasw44 (1 Post)
  107. thchuong (1 Post)
  108. twhra (1 Post)
  109. ronei (1 Post)
  110. qdano (1 Post)
  111. quintenvk (1 Post)

Tags for this Thread