[flexcoders] Re: totaling items in datagrid

2006-11-29 Thread nall_daniel
Thanks Ben, I already use similar code with a labelFunction to do sub-totals within the grid and it works very well. However, that code will only do calculations on a single row and not on an entire column. The code I wrote for totaling a column works as well but not on a new form where the

[flexcoders] Re: totaling items in datagrid

2006-11-29 Thread nall_daniel
Okay, I made a little progress on this. Instead of passing the mx:model (which is an array) to my Grand Total function I'm now passing the actual dataProvider which is an arrayCollection. Now, new forms show the grand total as well as previously existing forms being edited. That's where the

[flexcoders] Re: totaling items in datagrid

2006-11-29 Thread camlinaeizerous
to call your function after the array is populated call it right after you populate it when the event results. The event results are nto called till the query is finished and the data is pulled so it makes for a great time to run code like your function. It will also call your function again each

[flexcoders] Re: totaling items in datagrid

2006-11-29 Thread nall_daniel
Got it. The CF/Flex wizard will generate an ArrayCollection variable to hold the data for a datagrid sub-form. It will also generate a function get_result() that gets all the data for the entire form. I placed a call to my grand total function as the last line in get_result() and voila! Now

[flexcoders] Re: totaling items in datagrid

2006-11-28 Thread nall_daniel
No one has an answer to this? Or suggestions? --- In flexcoders@yahoogroups.com, nall_daniel [EMAIL PROTECTED] wrote: I am using the CF/Flex Application Wizard to generate a basic form based application. I have a Master datagrid that list all the purchase requests a user has submitted and a

[flexcoders] Re: totaling items in datagrid

2006-11-28 Thread bsdensmore
a labelfunction will do the calculations as you tab through the fields or as change rows on the grid. I use this to do some calculations and it works great. private function calcAdjAmount(item:Object,column:DataGridColumn):String { var adjustedAmt:Number;