Link to home
Start Free TrialLog in
Avatar of Brad Kennedy
Brad KennedyFlag for United States of America

asked on

cfgrid cell change to call JS

I'm looking for a way to call a javascript function when a single cell in a cfgrid is changed.
I have this functioning grid:

<cfform name="budgetForm" id="budgetForm">
                    <cfgrid format="html" height="265" width="870"
                    stripeRows="true" stripeRowColor="##f0f0f0"
                    selectmode="edit" delete="yes" deleteButton="Delete this item"pageSize="10"
                    bind="cfc:edit_budget.getBudgetItems({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})" name="budgetgrid" bindonload="true"
                    onchange="cfc:edit_budget.editData({cfgridaction},{cfgridrow},{cfgridchanged})">
                            <cfgridcolumn name = "bid" display ="false"  width ="5">
                            <cfgridcolumn name = "item_desc" header ="Item Description"  width ="190">
                            <cfgridcolumn name = "purpose" header ="Purpose" width ="170">
                            <cfgridcolumn name = "quantity" header ="Qty." width ="60">
                            <cfgridcolumn name = "price_per_unit" header ="Price per unit" width ="100">
                            <cfgridcolumn name = "shipping" header ="Shipping" width ="80">
                    </cfgrid>
                    </cfform>

So if the user makes change to either "quantity", "price_per_unit", or "shipping" cells,
 a js function will be called.

The js function should call a cfc that will calculate quantity x price_per_unit + shipping for all rows and then display the total in a div.

I think I can figure out the js and cfc, but I can't get the part where clicking on a single cell runs a script.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Coast Line
Coast Line
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Version Used is Coldfusion 9
Avatar of Brad Kennedy

ASKER

OK. Thanks for the help. The article is gonna get me where I want to go.