testing textarea to show stringified json
http://stackoverflow.com/questions/9189946/extjs-textarea-with-formatting
HTML
<link rel="stylesheet" href="http://dev.sencha.com/deploy/ext-4.0.7-gpl/resources/css/ext-all.css">
JavaScript
var form = Ext.create('Ext.form.FormPanel', {
title : 'Sample TextArea',
width : 400,
bodyPadding: 10,
renderTo : Ext.getBody(),
items: [{
xtype : 'textareafield',
grow : true,
name : 'message',
fieldLabel: 'Message',
anchor : '100%'
}]
});
jsonObj = {a: 'b', c: [1,2,3, 4]};
jsonString = JSON.stringify(jsonObj, null, '\t');
form.down("textareafield").setValue(jsonString);