PDA

View Full Version : Instant number format



sean881031
21 Apr 2015, 12:01 AM
I was trying to implement a feature in my project to support formating number fields instantly while typing. But it seems like ExtJS only provides a format behavior after BLUR, and there isn't any config or other built-in approaches to get this done in Ext.util.Format.number.

So I'm now trying to listen to a change event and manually do a formating. But the problem is, the logic seem complex, for example after every formating, I have to restore the curor positon: the cursor will be automatically shown at the end of the string. Especially in case of a format string '1,234.00'.

Is there a easier way to do this?

Regards,
Sean

tristan.lee
21 Apr 2015, 10:02 AM
Hi,

The formatters do not support this 'live' feature that you're looking to implement. You'll need to build your own logic to handle this, which it appears to have done.

Thanks,
Tristan