diff options
author | Natanael Copa <natanael.copa@gmail.com> | 2008-02-01 14:40:45 +0000 |
---|---|---|
committer | Natanael Copa <natanael.copa@gmail.com> | 2008-02-01 14:40:45 +0000 |
commit | 0818e8ec1ce0a2e3f71e7b0e551e0f4071ebfd2d (patch) | |
tree | 8dbeb4225ed6d39467e6d39b6bdbe31755a1cc8b /extjsdemo-html.lsp | |
parent | fffed594467064f07b480b0d651a541612b35a7f (diff) | |
download | acf-sandbox-0818e8ec1ce0a2e3f71e7b0e551e0f4071ebfd2d.tar.bz2 acf-sandbox-0818e8ec1ce0a2e3f71e7b0e551e0f4071ebfd2d.tar.xz |
added extjs demo
git-svn-id: svn://svn.alpinelinux.org/acf/sandbox/trunk@679 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'extjsdemo-html.lsp')
-rw-r--r-- | extjsdemo-html.lsp | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/extjsdemo-html.lsp b/extjsdemo-html.lsp new file mode 100644 index 0000000..7fd9534 --- /dev/null +++ b/extjsdemo-html.lsp @@ -0,0 +1,107 @@ +<? local ctl = ... ?> + +<!-- this could go in a separate .js file --> + +<script type="text/javascript"> + +Ext.onReady(function() { + Ext.QuickTips.init(); + + // turn on validation errors beside the field globally + Ext.form.Field.prototype.msgTarget = 'side'; + + var fp = new Ext.FormPanel({ + xtype:"form", + title:"Interface", + buttonAlign:"right", + id: "interface", + items:[{ + xtype:"fieldset", + title:"Eth0", + autoHeight:true, + items:[{ + xtype:"checkbox", + fieldLabel:"Enable interface", + boxLabel:"", + name:"ifenable", + inputValue:"cbvalue" + }, + + // create combobox + new Ext.form.ComboBox({ + fieldLabel:"Type", + hiddenName:"iftype", + store: new Ext.data.SimpleStore({ + fields: ['type', 'typedesc'], + data:[ + ['dhcp', 'Automatic (DHCP)'], + ['static', 'Static IP Address'] + ] + }), + valueField: 'type', + displayField: 'typedesc', + typeAhead: true, + triggerAction: 'all', + mode: 'local', + emptyText: 'Select Interface type...', + allowBlank: false, + selectOnFocus: true + }), + { + xtype:"textfield", + fieldLabel:"Address", + name:"address", +// allowBlank: false + },{ + xtype:"textfield", + fieldLabel:"Netmask", + name:"mask", +// allowBlank: false + },{ + xtype:"textfield", + fieldLabel:"Gateway", + name:"gateway" + }] + }], + }); + + var applybt = fp.addButton({ + text: 'Apply', +// disabled: true, + handler: function() { + fp.getForm().submit({ + url: 'submit', + waitMsg: 'Saving Data...' + }); + } + }); + + fp.render('interface-example'); + + // this connects to extjsdemo-controller.lua: load() + fp.getForm().load({url: 'load', waitMsg: 'Loading'}); + + fp.on({ + + actioncomplete: function(form, action) { + if (action.type == 'submit'){ + // we disable the apply button above to indicate succes + applybt.disable(); + } + }, +// actionfailed: function(form, action) { + // something failed +// alert('form.id = ' + form.id); +// } + + }); + + +}); + +</script> + +<h1>Extjs Test</h1> +<div id="msg"></div> +<div id="interface-example"></div> + |