View Full Version : How to validate properties for component?

26 Jun 2013, 11:54 PM

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

28 Jun 2013, 1:50 PM
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.

29 Jun 2013, 11:17 PM
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

30 Jun 2013, 1:41 PM
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.