]>
git.proxmox.com Git - sencha-touch.git/blob - src/examples/direct/direct.js
8 function doEcho(field
) {
9 TestAction
.doEcho(field
.getValue(), function(result
, event
) {
10 var transaction
= event
.getTransaction(),
11 content
= Ext
.String
.format('<b>Successful call to {0}.{1} with response:</b><pre>{2}</pre>',
12 transaction
.getAction(), transaction
.getMethod(), Ext
.encode(result
));
19 function doMultiply(field
){
20 TestAction
.multiply(field
.getValue(), function(result
, event
) {
21 var transaction
= event
.getTransaction(),
24 if (event
.getStatus()) {
25 content
= Ext
.String
.format('<b>Successful call to {0}.{1} with response:</b><pre>{2}</pre>',
26 transaction
.getAction(), transaction
.getMethod(), Ext
.encode(result
));
28 content
= Ext
.String
.format('<b>Call to {0}.{1} failed with message:</b><pre>{2}</pre>',
29 transaction
.getAction(), transaction
.getMethod(), event
.getMessage());
36 function updateMain(content
){
42 Ext
.direct
.Manager
.addProvider(Ext
.app
.REMOTING_API
, {
46 data: function(provider
, event
) {
47 updateMain('<i>' + event
.getData() + '</i>');
52 var main
= Ext
.create('Ext.Container', {
56 tplWriteMode
: 'append',
57 styleHtmlContent
: true,
62 title
: 'Remote Call Log'
70 emptyText
: 'Echo input'
75 doEcho(main
.down('#echoText'));
77 }, {xtype
: 'spacer'}, {
78 itemId
: 'multiplyText',
81 emptyText
: 'Multiply x 8'
86 doMultiply(main
.down('#multiplyText'));