PDA

View Full Version : Implement Grid Renderer functionality for a TextField and NumberField in a form



mayhem
16 Nov 2010, 9:38 AM
Hi,

I am sure this is easy, but I've not been able to find anything exactly what I am looking for.

I am have a json call which returns values and their units. For example parcelWeight and parcelWeightUnit. I have used a similar solutions for grids with the renderer to enable me to display the value in the grid of the value and the unit eg:
5 kg
100 ml

I now have a form where I want to implement the same thing but for a number of fields, so maybe the "renderer" would pass value and unit and they create the value for the field. This function would also set any decimal points on the value too.

What is the best way to implement? Do I need to extend the TextField and the setValue function. I want to do this cleanly and I know there is normally an easy was and I guessed someone must have done this before.

Thanks for suggestions.

ExtJS 3.2.1