PDA

View Full Version : applyTo non exist ??



wki01
22 Feb 2011, 11:52 PM
It appears that the property applyTo no longer exists.
The functionality has been removed or is there an equivalent property?
Thanks

firefoxSafari
23 Feb 2011, 3:01 PM
I'd like to know the future of applyTo as well.

I noticed that the config option was no longer in the docs. However, it still works at least in some cases. I tried a simple test with a Panel and a div with some text in it and it worked just fine.

Which component were you trying to use applyTo on?

wki01
24 Feb 2011, 4:59 AM
Inside the source I found this comment.
I would say that applyTo will no longer be supported.


// This needs to die a horrible death. For now it's a replaceMarkup, I can't see supporting this methodology going forward.
/**
* Apply this component to existing markup that is valid. With this function, no call to render() is required.
* @param {String/HTMLElement} el
*/
applyToMarkup: function(el) {
this.allowDomMove = false;
this.render(Ext.getDom(el).parentNode, null, true);
},

Condor
24 Feb 2011, 5:43 AM
It's not that easy anymore to do an applyTo because of the way the rendering process has been restructured in Ext 4.

That is why applyToMarkup currently replaces the specified element with the component (which is of course not the correct behavior).

devtig
24 Feb 2011, 10:52 AM
It may be a good idea to have configs, methods, events that have become obsolete, to still be in the ExtJS 4 API docs. Greyed out or something and mentioning the new way of doing it in ExtJS 4.

wki01
24 Feb 2011, 11:32 PM
This is a very big problem for me.
100% of my apps use a make-up already exists at the field level.
(I use Lotus Domino).
I wish I had an official response to the development team about the future support of the method applyTo.

Thanks

stevil
26 Feb 2011, 7:30 AM
It's not that easy anymore to do an applyTo because of the way the rendering process has been restructured in Ext 4.

That is why applyToMarkup currently replaces the specified element with the component (which is of course not the correct behavior).

I can certainly understand the challenge you face of keeping the architecture clean, fast, and stable. That said, I'm pretty sure there are a lot of Ext JS applications out there that rely on applyTo for legacy-rendered applications (my own included).

If applyTo is not supported, some other means of transforming HTML will be needed, or I'll have a hard time believing sencha's claim (when announcing Ext JS 4) that the vast majority of applications would just run with the compatibility layer/adapter in place.

jafarkhani.shabnam
29 Nov 2011, 3:55 AM
see this to add this property to your extjs

http://www.sencha.com/forum/showthread.php?158065-add-applyTo-to-Ext-4.1

micolator
22 Aug 2012, 12:03 AM
I replaced "applyTo" by "transform" for a combobox replacing a textField, and it works !

Hope this helps...

ontho
30 Aug 2012, 6:20 AM
I replaced "applyTo" by "transform" for a combobox replacing a textField, and it works !

Hope this helps...
This just saved my life =D>

wki01
30 Aug 2012, 7:02 AM
I replaced "applyTo" by "transform" for a combobox replacing a textField, and it works !

Hope this helps...

Someone explain to me how this thing works?
How do I use "transform" to a date field (xtype: datefield )?

thanks

ontho
30 Aug 2012, 7:06 AM
I haven't tested it with a datefield, but it should work like this:


<input id="mydatefield"....>

Ext.onReady(function(), {

Ext.create('Ext.form.fields.datefield', {
transform: 'mydatefield',
....
});
});

wki01
31 Aug 2012, 12:10 AM
I just can not understand how can you say that it works.
To me it does absolutely nothing.
Tested with 4.07 and 4.1.1
thanks

My small example


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>TEST</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<script type="text/javascript" src="../../ext-all.js"></script>
<script type="text/javascript" src="test.js"></script>
</head>
<body>
<h1>TEST</h1>
<input id="testfield">
</body>
</html>




Ext.require([
'Ext.form.*',
'Ext.form.field.*'
]);


Ext.onReady(function() {
Ext.create('Ext.form.TextField', {
transform: 'testfield'
});
});

thehawk
10 Dec 2012, 8:43 AM
"transform" did not work for me either. I really need the ability to take existing form fields and turn them into Ext controls.

billvs
10 Jul 2013, 11:31 AM
transform seems only work for combobox,
if you want it work for the date field or other form field,you can extent and add the config.

Roomy
13 Aug 2013, 11:15 PM
transform seems only work for combobox,
if you want it work for the date field or other form field,you can extent and add the config.

Ok, But how config can help in that?
Please share it.

Thanks