What about using part="xxx" and update="xxx"? (See http://cookbook.hobocentral.net/manual/ajax#the_part_context).

Henry

Matt Jones wrote:

On Apr 20, 2010, at 3:07 PM, Jeremy Savoy wrote:

I have a model for budget item entries. Each entry contains the total
cost, the amount paid, and the amount due on the item - all are typed
float

I would like for the amount_due to be calculated for the user whenever
there is a change in total cost or amount paid. This change could be
when the item is initially being created or edited at some future
point.

Is this something that I'll just have to implement in javascript/ajax,
or is there already functionality like this built into rapid?

Nothing I can think of offhand, but a somewhat related note: don't store dollar amounts as floats. It will work 99% of the time, but lose pennies occasionally due to rounding. Storing $ values as decimals will avoid this. In a soon-to-be-appearing Hobo update (ie, when I get around to it) you'll also be able to cleanly specify formatting / decimal places / etc, so your code won't be littered with "%.02f" and friends.

--Matt Jones


--
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to