-
Ext.ux.form.Message
Hi All
I have been going through the classes we have developed over the last few years and sharing back with the community some of them that I think will be useful to others. These components have been tested extensively in ext-3.2.1.
Here is: Ext.ux.form.Message
A form field that is not displayed but shows its value in an alert window
Code:
/**
* @author Will Ferrer, Ethan Brooks
* @copyright (c) 2012, Intellectual Property Private Equity Group
* @licensee 2012 developed under license for Switchsoft LLC http://www.switchsoft.com a "Direct response telephony company" as part of it's "VOIP Call distribution, ROI analysis platform, call recording, and IVR for inbound and outbound sales" and Run the Business Systems LLC a "Technology development investment group" as part of it's "PHP, Javascript rapid application development framework and MySQL analysis tools"
* @license licensed under the terms of
* the Open Source LGPL 3.0 license. Commercial use is permitted to the extent
* that the code/component(s) do NOT become part of another Open
Source or Commercially
* licensed development library or toolkit without explicit permission.
* <p>License details: <a href="http://www.gnu.org/licenses/lgpl.html"
* target="_blank">http://www.gnu.org/licenses/lgpl.html</a></p>
* We are pretty nice just ask. We want to meet our licensees
*/
/*
author: Will Ferrer
date: 09/11/09
*/
/**
* @class Ext.ux.form.Message
* @extends Ext.form.Hidden
* A form field that is not displayed but shows its value in an alert window
* @constructor
* @param {Object} config The config object
* @xtype ux-form-message
*/
Ext.ns('Ext.ux.form');
Ext.ux.form.Message = Ext.extend(Ext.form.Hidden, {
// @private
disabled : true,
initComponent : function () {
Ext.Msg.alert('Message', this.value);
Ext.ux.form.Message.superclass.initComponent.call(this);
}
});
Ext.reg('ux-form-message', Ext.ux.form.Message);
Best regards
Will Ferrer (Run the Business)
-
Why is this a form field? Would think a plugin for the form would be better. And what happens if you have 2 or more of them?
-
Hi Mitchel
We made this a form element because our forms contents are generated on the server side and displayed using our component Ext.ux.panel.RemoteInstantiateDirect. With some modifications to the back end however we could use a plugin for the same purpose. I did a quick test to see what would happen if there were 2 fields in the form and I see your point -- one alert would overwrite the other. I had expected it would result in 2 alerts.
Thank you for the input.
Best regards
Will Ferrer