Results 1 to 3 of 3

Thread: How to use custom type in Model

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    64
    Vote Rating
    7
      0  

    Default How to use custom type in Model

    We'd like to define a custom Ext.data.Type and use this in our Model.

    We discovered a problem with the Boolean default type -- in that it is case sensitive. We discovered this while working with an Ajax proxy to a server that returns boolean values as 'True/False'. The Ext.data.Types.BOOL type is case sensitive and treats them all as false. Of course we could define 'convert()' methods for every field sent back from the server (which is what we have done) -- but is would seem preferable to solve this with a sensible type definition.

    At first, we thought this was a bug (that BOOL was case sensitive), and files a bug report with the ExtJS forum (http://www.sencha.com/forum/showthre...-casesensitive) -- but they say this is not a bug, and we should prefer to define a custom type.

    So we're looking for help with how to refer to this custom type from within SA.

    Thanks
    Jim

  2. #2
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    64
    Vote Rating
    7
      0  

    Default

    bump?

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    321
    Vote Rating
    31
      1  

    Default

    At the moment, the only way to accomplish this would be to do an override and define it in custom code. That would work as an interim solution.

    However, in the next point release of Sencha Architect, you could accomplish this via a new feature called processConfig that will help for scenarios like this. ProcessConfig is essentially a hook to the config object prior to instantiation of the class.
    Steve Sobel
    @honestbleeps
    Sencha Architect Development Team

Posting Permissions

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