tsa
11 Aug 2008, 12:51 PM
Hi, all,
After upgrading to Ext 2.2 I found that overriding Ext.form.Field with a custom afterRender function keeps all the fields blank despite my specifying a value in its config. I confirmed that this was working in Ext 2.1.
Here's a very simple example:
<html>
<head>
<title>Test EXT</title>
<script charset="ISO-8859-1" type="text/javascript" src="js/Ext2/adapter/ext/ext-base.js"></script>
<script charset="ISO-8859-1" type="text/javascript" src="js/Ext2/ext-all-debug.js"></script>
<script charset="ISO-8859-1" type="text/javascript">
Ext.override(Ext.form.Field, {
afterRender : function() {
Ext.form.Field.superclass.afterRender.call(this);
} });
// Putting it all together...
var theViewport = null;
Ext.onReady(function() {
theViewport = new Ext.Panel({
layout:'fit',
renderTo: 'main',
items:[
new Ext.form.FormPanel(
{items: [new Ext.form.TextField(
{name: 'test1',
fieldLabel: 'Test 1',
value: 'test'
})]
})
]});
});
</script>
</head>
<body>
<div id="main">
</div>
</body>
</html>
The above will render a simple text field with no value in it. If you comment out or remove the override code it will work as expected.
After upgrading to Ext 2.2 I found that overriding Ext.form.Field with a custom afterRender function keeps all the fields blank despite my specifying a value in its config. I confirmed that this was working in Ext 2.1.
Here's a very simple example:
<html>
<head>
<title>Test EXT</title>
<script charset="ISO-8859-1" type="text/javascript" src="js/Ext2/adapter/ext/ext-base.js"></script>
<script charset="ISO-8859-1" type="text/javascript" src="js/Ext2/ext-all-debug.js"></script>
<script charset="ISO-8859-1" type="text/javascript">
Ext.override(Ext.form.Field, {
afterRender : function() {
Ext.form.Field.superclass.afterRender.call(this);
} });
// Putting it all together...
var theViewport = null;
Ext.onReady(function() {
theViewport = new Ext.Panel({
layout:'fit',
renderTo: 'main',
items:[
new Ext.form.FormPanel(
{items: [new Ext.form.TextField(
{name: 'test1',
fieldLabel: 'Test 1',
value: 'test'
})]
})
]});
});
</script>
</head>
<body>
<div id="main">
</div>
</body>
</html>
The above will render a simple text field with no value in it. If you comment out or remove the override code it will work as expected.