1. #11
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,105
    Vote Rating
    114
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Quote Originally Posted by SchattenMann View Post
    i would also like to suggest the ability to add custom property as an object or function. we can add custom property to a field but since they are escaped we can only add strings. it would be nice the ability to add functions. (this way we could force handler: function() for example)
    THe proper way to add a function is by adding it as a Basic Function to the object. In touch you are only allowed to do this if it matches a configuration or if its a top level class. (Ext's rules are more relaxed).

    If you want to add a boolean, number, etc just put a value in when you click Add.

    For example
    myBoolean: true

    Then click add
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  2. #12
    Sencha - Architect Dev Team jjohnston's Avatar
    Join Date
    Sep 2010
    Posts
    462
    Vote Rating
    15
    jjohnston will become famous soon enough jjohnston will become famous soon enough

      0  

    Default


    "i would also like to suggest the ability to add custom property as an object or function."

    I'm trying to understand your use case... what 'handler' are you wanting to set? It sounds like you're thinking custom configs will be able to help you do things that I'm not sure they actually will.

    If it's a known config supported by the Touch framework then you should already be able to implement it as a non-custom function.

    You're also already able to add custom functions, by dragging out a Basic Function -- the only limitation in Touch is that they can only go onto a class (a top-level component in the Inspector). This is a Touch framework limitation and not a limitation of Designer, because in Touch's class system any properties in the 'config' object that do not line up with known configs are essentially thrown away.
    Jason Johnston
    @lojjic
    Sencha Architect Development Team

  3. #13
    Sencha User
    Join Date
    Mar 2009
    Posts
    227
    Vote Rating
    0
    SchattenMann is an unknown quantity at this point

      0  

    Default


    i was thinking in buttons for example.

    i understand the correct way is the way Designer forces us to do: create a general listener with a delegate.

    but sometimes it's easier to have

    Code:
    {
          xtype:'button',
          handler: function () {}
    }
    easier...but not THAT important ofc

  4. #14
    Sencha - Architect Dev Team jjohnston's Avatar
    Join Date
    Sep 2010
    Posts
    462
    Vote Rating
    15
    jjohnston will become famous soon enough jjohnston will become famous soon enough

      0  

    Default


    Yes you're absolutely right, the fact that we're not exposing the 'handler' function on Button is a bug. I will fix this asap.

    Edit: this has been fixed for both frameworks and will appear in the next update.
    Jason Johnston
    @lojjic
    Sencha Architect Development Team

  5. #15
    Sencha User
    Join Date
    Mar 2009
    Posts
    227
    Vote Rating
    0
    SchattenMann is an unknown quantity at this point

      0  

    Default


    now that was fast

    glad i could help?

    any ETA for the next update?

  6. #16
    Sencha User
    Join Date
    Mar 2009
    Posts
    227
    Vote Rating
    0
    SchattenMann is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by jjohnston View Post
    As a workaround, you can do this:

    - Add an 'initialize' event binding to the Form Panel (not the field)
    - Set its handler code to:
    this.down('#mydatefield').setValue(new Date());
    i end up finding another problem on this.

    since we can't also do
    Code:
    {
        xtype:'datepickerfield',
        picker: {
            yearTo: new Date().getFullYear()+1
        }
    }
    in Designer i'm also using Form Panel Initialize event to do:

    Code:
    this.down('#datadoc').getPicker().setYearTo(new Date().getFullYear()+1);
    problem is getPicker() gets the picker but also shows the picker, meaning getPicker() == showPicker()

    since datepickerfield.picker is a boolean before the first time picker gets called that was the only way i've found...but it's basically useless.

    i've found this suggestion but for some reason Designer won't accept hidden:true in picker (option hidden is also not available so it has to be a custom option)