Results 1 to 2 of 2

Thread: Overriding DOM Element

  1. #1

    Default Overriding DOM Element

    Hi,
    Is there a way to override a method in dom.Element class?
    The following doesn't seem to invoke the overridden method in the overrides folder of the application:
    Code:
    Ext.define('Ext.overrides.dom.Element', {
        override: 'Ext.dom.Element',         xxxxxNode: function(node){    }});
    Thanks

  2. #2
    Sencha - Support Team
    Join Date
    Mar 2015
    Location
    Chicago
    Posts
    239
    Answers
    40

    Default

    Hi,

    Not sure what the problem is, this code worked just fine:

    Code:
    Ext.onReady(function(){
        Ext.define('Ext.o.Element',{
            override:  'Ext.dom.Element',
            getTest : function() {
                console.log('This method was called');
            }
        });
        Ext.create('Ext.Panel',{
            width: 200,
            height: 200,
            title: 'Testing',
            html : 'This is a testing panel',
            renderTo: document.body,
            listeners : {
                afterrender : function(panel) {
                    panel.body.el.getTest();
                }
            }
        });
    });
    Check this fiddle: https://fiddle.sencha.com/#fiddle/v3t
    Guilherme Lopes
    Sencha Support

Similar Threads

  1. Replies: 6
    Last Post: 12 Jan 2010, 3:46 AM
  2. OverRiding Ext.Element Methods (new syntax (addMethod())
    By brookd in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 13 Jul 2009, 11:14 AM
  3. Element.hide() element.setVisible() & Element.show()
    By xnoor in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 6 Apr 2008, 12:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •