Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    574
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default Ext.picker.Date updateDayText

    Ext.picker.Date updateDayText


    Hi,
    either I did not understand how to use the updateDayText method or it simply never worked.
    Here is my override:

    Code:
    /**
     * @author: Torsten Dinkheller (Mobile Game Design e.K., Germany)
     * 
     * Updates the methods for the dayText, monthText, yearText
     */
    Ext.define('App.override.picker.Date', {
        override: 'Ext.picker.Date',
    
    
        /**
         * Updates the monthText configuration
         */
        updateMonthText: function(newMonthText, oldMonthText) {
            this.updateDateText(newMonthText, oldMonthText);
        },
    
    
        /**
         * Updates the dayText configuraton
         */
        updateDayText: function(newDayText, oldDayText) {
            this.updateDateText(newDayText, oldDayText)
        },
    
    
        /**
         * Updates the yearText configuration
         */
        updateYearText: function(newYearText, oldYearText) {
            this.updateDateText(newYearText, oldYearText);
        },
    
    
        /**
         * Updates the Text configuration for day, month, year
         */
        updateDateText: function(newText, oldText) {
            var innerItems = this.getInnerItems(),
                ln = innerItems.length,
                item, i;
    
    
            //loop through each of the current items and set the title on the correct slice
            if (this.initialized) {
                for (i = 0; i < ln; i++) {
                    item = innerItems[i];
    
    
                    if ((typeof item.getTitle() == "string" && item.getTitle() == oldText) || (item.getTitle().getHtml() == oldText)) {
                        item.setTitle(newText);
                    }
                }
            }
        }
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,124
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    And how are using it?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    574
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default how to use it

    how to use it


    First of it already was in the Date.js, I just fixed it, as it did not work before.

    Here is an example on how to use it:

    Controller:
    Code:
    config: {
        refs: {
            desiredDatePicker: 'datepicker'
        },
        control: {
            desiredDatePicker: {
                show: function(){
                    this.getDesiredDatePicker().updateDayText('Tag', 'Day');
                },
            }
        }
    }

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,124
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You aren't understanding the whole concept of the configs. Each config within the config object will get a getter and setter method created. The getter will simply return the value of the property the setter however does more than just sets the property. When the setter method is executed it first looks to see if there is an applier method. If there is it will execute that applier method that can transform the value into something and returns that. It then sets the property. Then it will see if there is an updater method, if there is then it will execute that updater method. The updateDayText is an updater method so you shouldn't really call it but call it's setter method.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    574
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default Getter and Setter

    Getter and Setter


    So, what you are saying is, that the original works:

    Code:
    /**     * Updates the monthText configuration
         */
        updateMonthText: function(newMonthText, oldMonthText) {
            var innerItems = this.getInnerItems,
                ln = innerItems.length,
                item, i;
    ...
    So the first line -
    this.getInnerItems
    - works without brackets?

    Why is it this.getInnerItems and not this.getInnerItems()?

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,124
    Vote Rating
    855
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    No, I'm saying you shouldn't execute updateMonthText but execute setMonthText instead and that setter will then execute updateMonthText for you.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  7. #7
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    574
    Vote Rating
    31
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default


    . When you asked me for an example on how to use it, I had to come up with an example.
    So I gave that example to you.

    Usually I am only using 'get' and 'set' so this seems to be a big misunderstanding.
    Anyways thanks for sharing the knowledge so that I know now why to only use the get and set and you helped me finding the right code example, which should have been:

    Code:
    config: {
        refs: {
            desiredDatePicker: 'datepicker'
        },
        control: {
            desiredDatePicker: {
                show: function(){
                    // set 'Tag' which is the German word for  'day'
                    this.getDesiredDatePicker().setDayText('Tag');
                },
            }
        }
    }
    right?

Thread Participants: 1

Tags for this Thread