Ext.define("Viewport",{
extend: "Ext.Viewport",
layout: "border",
items:[{
region: "north",
html: "<h1>Web Site</h1>",
autoHeight: true,
border: false,
},{
region: "center",
xtype: "form",
url: "http://localhost:8181/website/rest/service/newEmployee/",
items: [{
xtype:"textfield",
name: "fname",
fieldLabel: "First name"
}, {
xtype:"textfield",
name: "sname",
fieldLabel: "Second name"
}, {
xtype:"textfield",
name: "position",
fieldLabel: "Position"
}],
buttons:[{
text: "Reset",
handler: function(){
this.up("form").getForm().reset();
}
},{
text: "Save",
handler: function(){
var form = this.up("form").getForm();
form.submit({
success: function(form, action){
Ext.Msg.alert("Success", action.result.msg);
},
failure: function(form, action){
Ext.Msg.alert("Failed", action.result.msg);
}
});
}
}]
},{
region: "west",
width: 150,
collapsible: true,
split: true,
title: "West side",
layout: "accordion",
items:[{
title:"Title 1"
}, {
title:"Title 2"
}
]
}
]
});
Ext.create("Viewport");
Вот только пока еще не настроил отправку в формате json