mystix
7 Jun 2007, 6:59 AM
Hi jack,
in both 1.0.1a and 1.1 beta 1, the pre-transformation width of HTML elements is not preserved in the Ext.form.Field transformation process.
here's my drop-in test code for 1.1b1:
<html>
<head>
<title>Pre / Post-transform width</title>
<link rel='stylesheet' href='resources/css/ext-all.css'>
<script src='adapter/ext/ext-base.js'></script>
<script src='ext-all-debug.js'></script>
<script>
Ext.onReady(function() {
(new Ext.form.DateField()).applyTo('test');
});
</script>
</head>
<body>
<input type='text' id='dummy' size='100'/>
<input type='text' id='test' size='100'/>
</body>
</html>
imho, i thought it would be good if the post- and pre-transform widths were the same to prevent positioned elements from running amok after Field transformations.
for now, here's my somewhat ugly suggestion (tested in 1.0.1a and 1.1b1):
Ext.override(Ext.form.Field, {
applyTo : function(target) {
this.target = target;
this.el = Ext.get(target);
this.width = this.width || this.el.getWidth(); // store pre-transform width before rendering
this.render(this.el.dom.parentNode);
return this;
}
});to preserve the pre-transform width.
Could something like this be added to the trunk?
in both 1.0.1a and 1.1 beta 1, the pre-transformation width of HTML elements is not preserved in the Ext.form.Field transformation process.
here's my drop-in test code for 1.1b1:
<html>
<head>
<title>Pre / Post-transform width</title>
<link rel='stylesheet' href='resources/css/ext-all.css'>
<script src='adapter/ext/ext-base.js'></script>
<script src='ext-all-debug.js'></script>
<script>
Ext.onReady(function() {
(new Ext.form.DateField()).applyTo('test');
});
</script>
</head>
<body>
<input type='text' id='dummy' size='100'/>
<input type='text' id='test' size='100'/>
</body>
</html>
imho, i thought it would be good if the post- and pre-transform widths were the same to prevent positioned elements from running amok after Field transformations.
for now, here's my somewhat ugly suggestion (tested in 1.0.1a and 1.1b1):
Ext.override(Ext.form.Field, {
applyTo : function(target) {
this.target = target;
this.el = Ext.get(target);
this.width = this.width || this.el.getWidth(); // store pre-transform width before rendering
this.render(this.el.dom.parentNode);
return this;
}
});to preserve the pre-transform width.
Could something like this be added to the trunk?