Results 1 to 4 of 4

Thread: DatePicker value code generated incorrectly

    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
    45
    Vote Rating
    3
      0  

    Default 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 User
    Join Date
    Jan 2009
    Posts
    409
    Vote Rating
    239
      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 User Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,953
    Vote Rating
    65
      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

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2012
    Location
    Singapore
    Posts
    45
    Vote Rating
    3
      0  

    Default

    TQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •