PDA

View Full Version : Renderer in a Form?



jezmck
8 Apr 2008, 4:55 AM
I'd like to be able to use custom renderers on form fields, as I can in EditorGrids.
A commonly used one would be for money.

I did a quick search and was surprised not to find other users requesting the same feature.

Has anyone done this, or have any suggestions?

8 Apr 2008, 5:28 AM
do you mean a string formatter?

jezmck
8 Apr 2008, 5:32 AM
er, maybe?

I want my users to be able to type a number in an input and when that field loses focus for it to be formatted by a function.
Exactly like (custom) renderers in EditorGrids.

jezmck
8 Apr 2008, 7:34 AM
bump :">

8 Apr 2008, 9:31 AM
Have you looked at the source code for the fields?

jezmck
9 Apr 2008, 12:06 AM
I have now, but didn't see any mention of string formatting, or renderers.
If you're trying to tell me that I will have to implement this functionality then just say so.

jezmck
9 Apr 2008, 3:35 AM
I'm not asking for a complete copy-paste solution here, just a nudge in the right direction.

9 Apr 2008, 4:05 AM
for the output, look at setValue for input formatting, use vtypes.

jezmck
9 Apr 2008, 4:26 AM
thank you.
that was hard work though, getting a simple answer, you could have just said "no, you will have to implement something yourself, using setValue()".

9 Apr 2008, 4:37 AM
You would have gotten your answer by looking at the API or even inspecting a field with firebug.

jezmck
10 Apr 2008, 4:58 AM
please show me how firebug would have helped.
also, as everyone knows, just because something isn't in the docs doesn't mean it doesn't exist.

10 Apr 2008, 5:03 AM
I agree. this is why i included firebug in this. console.log(yourobj).

10 Apr 2008, 5:04 AM
that's why i also suggested reading the source. I wasn't being sarcastic, just merely suggesting. However, take it how you wish.

jezmck
10 Apr 2008, 5:04 AM
ah okay, I thought you meant "inspect with firebug" literally.

10 Apr 2008, 5:06 AM
I consider drilling down into an object 'inspecting' :)