Results 1 to 4 of 4

Thread: How to validate properties for component?

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    55
    Answers
    2

    Default How to validate properties for component?

    Hi,

    I have a panel, for this panel i gave 'layout':'123',

    the panel was disappear.

    how to validate the property and show the error message?

    Thanks in advance

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    I'm not totally sure what you're looking to do.
    Can you share what you've done so far and perhaps explain again in a bit more depth and perhaps that will help the community know better how to aid you.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    55
    Answers
    2

    Default

    Hi slemmon,

    I am creating one application like sencha architect. for that only i need that functionality.

    I drag a panel and place one designer window. in property grid i changed the layout value. if i gave wrong value the panel was vanished. how can i validate the value for panel property?

    Please give some idea for that.

    Thanks in advance

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    The layout config needs to translate to a class with alias layout.xxx. So to validate that property you just need to check whether such a class exists, e.g. using getNameByAlias.

    However, if your question is about how to validate properties more generally then the answer is you can't. You'd need to code rules specific to each property. You could, perhaps, save a little time by using the docs to extract some of the most common cases but you'd have to apply many special cases.

Posting Permissions

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