This duplicates another bug already reported in our system: DSGNR-1120
  1. #1
    Ext JS Premium Member Artistan's Avatar
    Join Date
    Apr 2007
    Location
    MN
    Posts
    144
    Vote Rating
    0
    Artistan is on a distinguished road

      0  

    Default Data Model Validations: Format Validation

    Data Model Validations: Format Validation


    Does not have a Property for matcher regex.

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,266
    Vote Rating
    121
    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


    Please post a code snippet of what you are looking to define in the Designer that you are unable to.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Ext JS Premium Member Artistan's Avatar
    Join Date
    Apr 2007
    Location
    MN
    Posts
    144
    Vote Rating
    0
    Artistan is on a distinguished road

      0  

    Default


    http://www.sencha.com/learn/using-va...n-sencha-touch
    format with a "matcher"
    There is no matcher property on the Format Validation Component.

    Code:
    Ext.ns('MyApp');   MyApp.Product = Ext.regModel('Product', {     fields: [         {name: 'id',      type: 'int'},         {name: 'user_id', type: 'int'},         {name: 'name',    type: 'string'},         {name: 'price',   type: 'float'},         {name: 'sku',     type: 'string'}     ],       validations: [         {type: 'presence', name: 'name'},         {type: 'format',   name: 'sku', matcher: /[0-9]{4}[A-Z]+/},         {type: 'length',   name: 'name', min: 3}     ],       proxy: {         type: 'localstorage',         id  : 'products'     } });

  4. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    3
    Vote Rating
    0
    thermos192 is on a distinguished road

      0  

    Default Tried adding matcher with the filter box

    Tried adding matcher with the filter box


    I tried adding a matcher by typing it in the filter list box and clicking the add button, it puts the value inside tics though so regular expressions don't work. Manually taking the tics out in the code works but of course designer saves over it. Adding it to the file outside of designer works but then designer doesn't see it when the project is loaded.

    Is there a way to add something with the filter box without designer putting quotes around it in the code?

  5. #5
    Sencha User
    Join Date
    Dec 2011
    Location
    México
    Posts
    11
    Vote Rating
    0
    oresistemas is on a distinguished road

      0  

    Default Use the matcher as an object

    Use the matcher as an object


    You can try to use the matcher as an object and put the value of the object between slashs ("/"), for example:

    /^[-]?[0-9]*[.]{0,1}[0-9]*$/

    In my case this results in:
    {
    type: 'format',
    message: 'Format error',
    matcher: /^[-]?[0-9]*[.]{0,1}[0-9]*$/,
    field: 'field01'
    }


    I hope this can help you.