View Full Version : Serialization of Extjs Components (obtain Json strings from Extjs objects)

8 Jun 2011, 6:05 AM
I'm developping a dynamic form designer (a panel with dynamic number of checkboxes, textfields...) and I want to obtain the Json string of a panel containing dynamic content (like in Ext designer).
I have tried JSON.stringify(component) and Ext.encode(component) but in both cases I get the "too much recursion error".

Is there any way to obtain directly the Json string of a panel containing dynamic content?

Thank you.

13 Jun 2011, 8:15 AM
Hello, I have succeded to stringify complex objects using the property initialConfig.

For example if I have a panel with multiple objects:

var k = JSON.stringify(mypanel.initialConfig);

The final string is very similar to the code generated in EXT.designer.