How do I use an extended control in a ASPX page??????

  1. #1

    How do I use an extended control in a ASPX page??????

    SearchTextField.js
    Ext.namespace('Ext.ux.form');
    
    Ext.ux.form.SearchTextField = function (config) {
        Ext.ux.form.SearchTextField.superclass.constructor.call(this, config);
    };
    
    Ext.ux.form.SearchTextField = Ext.extend(Ext.form.TextField, {
    
        searchModeEnabled: true,
        failureFn: null,
        successFn: null,
        searchUrl: null,
        extraParameterName: 'identificador',
    
        initComponent: function () {
            Ext.ux.form.SearchTextField.superclass.initComponent.call(this);
        },
    
        // private
        initEvents: function () {
            Ext.ux.form.SearchTextField.superclass.initEvents.call(this);
        },
    
        onRender: function (ct, position) {
            Ext.ux.form.SearchTextField.superclass.onRender.call(this, ct, position);
        }
    });
    
    Ext.reg('searchtextfield', Ext.ux.form.SearchTextField);
    How do I use this control in my ASPX page?
    <script type="text/javascript" src="SearchTextField.js"></script>
    Using the following anywhere
    <ext:searchtextfield runat="server" id="gg"></ext:searchtextfield>
    I get the error
    Unknown server tag 'ext:searchtextfield'.
    Last edited by Daniil; Aug 04, 2011 at 9:49 AM. Reason: Please use [CODE] tags
  2. #2
    Hi,

    A JavaScript class is not enough to use it as Asp.Net server control.

    You should create a C# wrapper class and attach it to a page like this (or in web.config)
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    You should set up respective Assemblyand Namespace.

    You can extend the Ext.Net.TextField class.

    You will need to override .InstanceOf and .XType properties.

    Here is some manual.
    http://forums.ext.net/showthread.php?7946

Similar Threads

  1. Replies: 2
    Last Post: Nov 15, 2012, 12:52 AM
  2. Replies: 7
    Last Post: Jul 31, 2012, 8:31 PM
  3. Replies: 0
    Last Post: Sep 21, 2011, 3:14 PM
  4. Replies: 7
    Last Post: Apr 14, 2011, 10:52 PM
  5. Replies: 2
    Last Post: Aug 27, 2009, 8:12 AM

Posting Permissions