X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/ee06f37b0f6f6d94cd05a6ffae556660f7c4a2bc..c930e9176a5a85509c5b0230e2bff5c22a591432:/examples/direct/direct.js?ds=sidebyside diff --git a/examples/direct/direct.js b/examples/direct/direct.js new file mode 100644 index 00000000..f3f77b48 --- /dev/null +++ b/examples/direct/direct.js @@ -0,0 +1,88 @@ +/*! + * Ext JS Library 3.0.0 + * Copyright(c) 2006-2009 Ext JS, LLC + * licensing@extjs.com + * http://www.extjs.com/license + */ +Ext.onReady(function(){ + Ext.Direct.addProvider( + Ext.app.REMOTING_API, + { + type:'polling', + url: 'php/poll.php' + } + ); + + var out = new Ext.form.DisplayField({ + cls: 'x-form-text', + id: 'out' + }); + + var text = new Ext.form.TextField({ + width: 300, + emptyText: 'Echo input' + }); + + var call = new Ext.Button({ + text: 'Echo', + handler: function(){ + TestAction.doEcho(text.getValue(), function(result, e){ + var t = e.getTransaction(); + out.append(String.format('
Successful call to {0}.{1} with response:
Successful call to {0}.{1} with response:
Call to {0}.{1} failed with message:
{0}
', e.data)); + out.el.scroll('b', 100000, true); + }); +});