Mar 01, 2012, 4:17 AM
[CLOSED] How to format the value of a DisplayField in javascript?
Hi,
I have a details FormPanel having a few DisplayFields databound to a GridPanel. Is there any way to format the value of the DisplayField after it's loaded into the form, e.g. format the date or currency, etc.
I have attempted to use a Render listener on a DisplayField. However, every time it fires, the value of the DisplayField is empty but is populated after the renderer completes.
Thanks,
Vadym
I have a details FormPanel having a few DisplayFields databound to a GridPanel. Is there any way to format the value of the DisplayField after it's loaded into the form, e.g. format the date or currency, etc.
I have attempted to use a Render listener on a DisplayField. However, every time it fires, the value of the DisplayField is empty but is populated after the renderer completes.
Thanks,
Vadym
<script>
var formatDate = function (displayField) {
alert(displayField.getValue()); // Empty
};
</script>
<ext:DisplayField ID="DisplayDate1" runat="server" DataIndex="Date1">
<Listeners>
<Render Fn="formatDate" />
</Listeners>
</ext:DisplayField>
Last edited by Daniil; Mar 01, 2012 at 3:02 PM.
Reason: [CLOSED]