Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------------------------------------
- // sa.TEST application
- //---------------------------------------------------------------------
- // Copyright (C) 2007-2013 The NOC Project
- // See LICENSE for details
- //---------------------------------------------------------------------
- console.debug("Defining NOC.sa.TEST.Application");
- Ext.define("NOC.sa.TEST.Application", {
- extend: "NOC.core.Application",
- requires: ["Ext.ux.form.UCField"],
- layout: { type: 'vbox', align: 'stretch' },
- border: 0,
- items : [{
- xtype: "container",
- items: [{
- xtype: 'form',
- border: 0,
- url: "/sa/TEST/",
- padding: 0,
- bodyPadding: 0,
- waitMsgTarget : true,
- defaults: {
- enableKeyEvents: true,
- listeners: {
- specialkey: function(field, key) {
- if (field.xtype != "textfield")
- return;
- var get_button = function(scope, name) {
- return scope.ownerCt.down("toolbar").getComponent(name);
- }
- switch(key.getKey()) {
- case Ext.EventObject.ENTER:
- var b = get_button(field, "summ");
- key.stopEvent();
- b.handler.call(b);
- break;
- }
- }
- },
- xtype: "textfield",
- msgTarget : "side",
- size: 30
- },
- items: [
- {
- xtype: 'textfield',
- name: 'a',
- },
- {
- xtype: 'textfield',
- name: 'b',
- },
- {
- xtype: 'button',
- text: 'summ',
- handler : function() {
- var form = this.up("form").getForm();
- form.submit({
- method: "GET",
- submitEmptyText : false,
- params : { __format: "ext" },
- success: function(form, action) {
- form.owner.up("panel").down("textareafield").setValue(action.result.summ);
- }
- });
- }
- },
- {
- xtype: "textarea",
- name: 'summ',
- flex: 1
- }
- ]
- }]
- }]
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement