Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member
    Join Date
    Sep 2012
    Location
    Singapore
    Posts
    34
    Vote Rating
    3
    Yazid is on a distinguished road

      0  

    Default DatePicker value code generated incorrectly

    DatePicker value code generated incorrectly


    Architect Build tested:
    • Build: 971
    Project Type:
    • Touch 2.x
    Description:
    • When I set the value in Property Panel to object and type
      Code:
      new Date()
      , the generate code is
      Code:
      newDate()
      (no space in between) and this cause an error.
    Steps to reproduce the problem:
    • Create a new Touch 2.x project
    • Add a form panel, add a datepicker
    • Set the value in property panel to Object and type
      Code:
      new Date()
    • See the generate code
    The result that was expected:
    • it should be new Date() with a space in between.
    The result that occurs instead:
    • error newDate() invalid
    HELPFUL INFORMATION


    Screenshot, Project, or Video:
    Property
    Screen Shot 2013-05-12 at 8.50.52 PM.png
    Enter code in the value object
    Screen Shot 2013-05-12 at 8.50.57 PM.png
    Generate code
    Screen Shot 2013-05-12 at 8.51.07 PM.png
    Operating System:
    • OS X

  2. #2
    Sencha Premium Member
    Join Date
    Jan 2009
    Posts
    318
    Vote Rating
    47
    firefoxSafari has a spectacular aura about firefoxSafari has a spectacular aura about firefoxSafari has a spectacular aura about

      1  

    Default


    I could be wrong here, but I don't think typing arbitrary JavaScript is supposed to work.

    When the config is set to Object, it's expecting an object literal with attributes of year, month, and day, as in

    Code:
                     {
                        year: 2013,
                        month: 5,
                        day: 29
                    }
    If you want to use arbitrary JavaScript to set values in the config, I think you need to add an initialize function in Sencha Touch. See the Using Variables with Configs section of the docs:

    http://docs.sencha.com/architect/2/#...e/config_panel

  3. #3
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Baltimore, MD
    Posts
    1,849
    Vote Rating
    57
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default


    firefoxSafari is correct in that we don't allow js directly like this. We realize this is a pain. The exact link is: http://docs.sencha.com/architect/2/#...anel-section-8
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2012
    Location
    Singapore
    Posts
    34
    Vote Rating
    3
    Yazid is on a distinguished road

      0  

    Default


    TQ

Thread Participants: 2