Mar 26, 2009, 2:40 PM
New Plugin
Hi,
I
downloaded the Coolite.ux.InputMask and me interested in creating a
plugin to edit values (R$ 324.55 for example). Following the model
of InputMask tutorial and the link:
http://extjs.com/learn/Manual:Intro:Inheritance.
I started a plugin MyCurrency as the code below to test.
MyCurrency.cs
Any tips?
Thank you.
Maia.
I
downloaded the Coolite.ux.InputMask and me interested in creating a
plugin to edit values (R$ 324.55 for example). Following the model
of InputMask tutorial and the link:
http://extjs.com/learn/Manual:Intro:Inheritance.
I started a plugin MyCurrency as the code below to test.
MyCurrency.cs
/********
* Copyright (c) 2008 Coolite Inc.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* @version: 0.7.0
* @author: Coolite Inc. http://www.ext.net/
* @date: 2008-11-21
* @copyright: Copyright (c) 2006-2008, Coolite Inc, or as noted within each
* applicable file LICENSE.txt file
* @license: MIT
* @website: http://www.ext.net/
********/
using System.ComponentModel;
using System.Web.UI;
using Coolite.Ext.Web;
using System.Drawing;
namespace Coolite.Ext.UX
{
/*
* MyCurrency
*/
[InstanceOf(ClassName = "Ext.ux.netbox.MyCurrency")]
[ClientScript(Type = typeof(MyCurrency), WebResource = "Coolite.Ext.UX.Plugins.MyCurrency.resources.MyCurrency.js")]
[ToolboxBitmap(typeof(Coolite.Ext.UX.MyCurrency), "Build.Resources.ToolboxIcons.Plugin.bmp")]
[ToolboxData("<{0}:MyCurrency runat=\"server\" />")]
[Description("MyCurrency plugin used for mask/regexp operations")]
public class MyCurrency : Plugin
{
[ClientConfig]
[Category("Config Options")]
[DefaultValue("")]
[NotifyParentProperty(true)]
[Description("The MyCurrency")]
public string Simbol
{
get
{
object obj = this.ViewState["Simbol"];
return obj == null ? "" : (string)obj;
}
set
{
this.ViewState["Simbol"] = value;
}
}
}
}
MyCurrency.js
Ext.namespace('Ext.ux.netbox');
/*
* MyCurrency
*
*/
Ext.ux.netbox.MyCurrency = function(simbol) {
var simb = simb.Simbol;
};
Ext.extend(Ext.ux.netbox.MyCurrency, Ext.form.TextField, {
theDocument: Ext.get(document),
myCurrencyFn1: function() {
// etc.
},
myCurrencyFn2: function() {
// etc.
}
});
Ext.ux.MyCurrency = Ext.ux.netbox.MyCurrency;
I put the plugin on the page and run the error occurs:Ext.ux.netbox.MyCurrency is not a constructor
Any tips?
Thank you.
Maia.