summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/fcl-web/examples/jsonrpc/extdirect/extdemo.js
blob: 8d27255d1f7c9e294eb8252c542f8ce0a0c6b5bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* 
  Define namespace FPC 
*/

Ext.ns('FPC');

/* 
  Include our server-side Ext.Direct API; The default name 'FPWeb' was used
*/

Ext.Direct.addProvider(FPWeb);

/* 
  Callback used to process result. It will show the actual page
*/

FPC.ShowResult = function (Provider,Response) {
  var panel = new Ext.Panel({
    renderTo: Ext.getBody(),
    frame: true,
    title: "Adding 1.2 and 3.4 = " + Response.result,
    height: 50,
    width: 200,
    html: "The result is : " + Response.result
   });
  panel.show();
}

/* 
  onReady callback function 
*/

FPC.ShowPage = function () {
  /* 
    Call our API, using FPC.ShowResult as the callback to process the result 
  */
  DemoClass.Add(1.2, 3.4, FPC.ShowResult);
}

/* 
  Start Extjs 
*/

Ext.onReady(FPC.ShowPage);