-
7 Nov 2011 11:50 PM #1
Answered: Override onRender
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.
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.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); } });
Could anybody of you give me a hint what the error is?
Yours
Thomas
-
Best Answer Posted by Werzi2001
Hi,
thanks for your reply. I couldn't use "arguments" as i want to change the ct-parameter but
did the trick.Code:this.callParent([places[0], position]);
Yours
Thomas
-
8 Nov 2011 12:10 AM #2Ext JS Premium Member
- Join Date
- Apr 2008
- Location
- Groningen - Netherlands
- Posts
- 1,017
- Vote Rating
- 23
- Answers
- 75
the input of callParent is an Array
try callParent(arguments)
-
8 Nov 2011 12:25 AM #3
Hi,
thanks for your reply. I couldn't use "arguments" as i want to change the ct-parameter but
did the trick.Code:this.callParent([places[0], position]);
Yours
Thomas


Reply With Quote