Results 1 to 3 of 3

Thread: Override onRender

  1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    79
    Answers
    2
    Vote Rating
    4
      0  

    Default Answered: Override onRender

    Hi,

    i would like to override the "onRender" method in order to insert some html and render the field to that html.

    Code:
    Ext.define('Ext.ux.form.FileField', {
        extend: 'Ext.form.field.File',
        
        alias: 'widget.uxfilefield',
        
        // private
        onRender: function(ct, position) {
            /* create placeholder */
            var html = '<table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';
            var element = ct.insertSibling({
                html: html
            }, null, true);
            
            /* get places */
            var places = Ext.DomQuery.select('td', element);
            
            /* render field */
            this.callParent(places[0], position);
        }
    });
    This is my current code but it doesn't work and i can't figure out why. The html gets inserted but the callParent seems to fail.

    Could anybody of you give me a hint what the error is?

    Yours
    Thomas

  2. Hi,

    thanks for your reply. I couldn't use "arguments" as i want to change the ct-parameter but
    Code:
    this.callParent([places[0], position]);
    did the trick.

    Yours
    Thomas

  3. #2
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,154
    Answers
    87
    Vote Rating
    34
      0  

    Default

    the input of callParent is an Array

    try callParent(arguments)

  4. #3
    Sencha User
    Join Date
    Dec 2009
    Posts
    79
    Answers
    2
    Vote Rating
    4
      0  

    Default

    Hi,

    thanks for your reply. I couldn't use "arguments" as i want to change the ct-parameter but
    Code:
    this.callParent([places[0], position]);
    did the trick.

    Yours
    Thomas

Posting Permissions

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