PDA

View Full Version : Change xtype



alekseyyp
11 Jun 2010, 4:24 AM
Hi everyone,
I am trying to find out, but have not results. So, can You help me, please?
I want to change xtype for extjs Element on fly. For example:
I have the html:


<input type="checkbox" id="my-ch" />
I have get the element in JS:


var el = Ext.get("my-ch");
and I want to have example of class Checkbox (http://localhost/ext311/docs/source/Checkbox.html#cls-Ext.form.Checkbox) to use its methods, events, e.t.c.

So, I think it is convertation from Ext.Element to Ext.form.Checkbox


Is it possible? Or Should I create checkbox on fly to have example of class Checkbox?


Many Thanks~!

wm003
11 Jun 2010, 4:35 AM
The Ext.form.Checkbox methods, attributes, events are not available on a standard-input-tag as you have defined above.
You need to instantiate an Ext.form.Checkbox to be able to use all the magic.

alekseyyp
11 Jun 2010, 4:36 AM
clear,
Thank You for quick reply

mitchellsimoens
11 Jun 2010, 6:29 AM
you can do something like this with applyTo


new Ext.form.Checkbox({
....
applyTo: "my-ch"
....
});

alekseyyp
15 Jun 2010, 5:13 AM
This is what I was looking for. This is magic :)))) Many Thanks!


you can do something like this with applyTo


new Ext.form.Checkbox({
....
applyTo: "my-ch"
....
});