JSFiddle - React, Tailwind, and code Playground
by johanhaest
HTML
<link rel="stylesheet" href="http://cdn.sencha.io/ext-4.1.1-gpl/resources/css/ext-all.css">
JavaScript
Ext.onReady(function () {
var servletJSON = {
name: "John",
surname: "Doe"
};
var window = Ext.create('Ext.window.Window', {
width: 300,
items: [{
xtype: 'form',
bodyPadding: 5,
defaults: {
anchor: '100%'
},
items: [{
xtype: 'textfield',
name: 'name',
fieldLabel: 'Name'
}, {
xtype: 'textfield',
name: 'surname',
fieldLabel: 'Surname'
}]
}],
buttons: [{
text: 'Load data',
handler: function(button) {
var window = button.up('window');
var form = window.down('form').getForm();
//Your request to get the servletJSON
form.setValues(servletJSON);
}
}]
}).show();
});