Results 1 to 2 of 2

Thread: Setting grid date field formats from a variable (or function)

  1. #1
    Sencha Premium Member
    Join Date
    Jun 2013
    Posts
    2

    Default Setting grid date field formats from a variable (or function)

    Hi,

    Is there any way of setting the format on grid date fields from a variable? I have a grid with several date fields in it where the format may need to be user defined. If they were all the same format, I can see I would set the Ext.Date.defaultFormat to override them, but I've got a mixture of Date & DateTime formats and this doesn't work, because you can only specify one format.

    I've tried just referencing a variable in the format field, but because Architect (v2.2.2 build 991) automatically surrounds the value you enter with quotes, what you end up with in the generated JavaScript file is a literal value, like 'MyApp.dateFormat', which the application tries to parse as the format.

    If I hand edit the generated JavaScript and remove the quotes, then the variable is interpreted correctly, and I get the required result, but of course, as soon as I save the Architect project again, the quotes get added back in.

    Does anyone know of a way around this problem?

    Cheers

    Lance

  2. #2
    Sencha Premium Member
    Join Date
    Jun 2013
    Posts
    2

    Default

    Got round it in the end by creating a 'process' function and setting config.format in that.

    Lance

Posting Permissions

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