Right well I worked out how to do it! As nobody on this list knows how to do
it I thought I would share the answer!
To have more than one select binding to a cfgrid just add actionscript to
the cfgrid. By trial and error I worked out that you do the following:
On the cfgrid(this uses three cfselects):
<cfgrid name="UsersGrid" format="Flash"
query="qNames" rowheaders="No"
onchange="for (var i:Number = 0; i<state.length; i++) {if
(state.getItemAt([i]).data == UsersGrid.selectedItem.state)
state.selectedIndex = i} for (var i:Number = 0; i<meetingtime.length; i++)
{if (meetingtime.getItemAt([i]).data == UsersGrid.selectedItem.meetingtime)
meetingtime.selectedIndex = i}
for (var i:Number = 0; i<dept.length; i++) {if (dept.getItemAt([i]).data ==
UsersGrid.selectedItem.dept) dept.selectedIndex = i}
for (var i:Number = 0; i<city.length; i++) {if (city.getItemAt([i]).data ==
UsersGrid.selectedItem.city) city.selectedIndex = i}">
On the cfselect:
<cfselect name="dept" width="200" size="1" label="Dept."
onchange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex, 'dept',
dept.selectedItem.data);">
<option value="None">None</OPTION>
<option value="Cundinamarca">Cundinamarca</OPTION>
<option value="Antioquia">Antioquia</OPTION>
<option value="Boyaca">Boyaca</OPTION>
<option value="Sucre">Sucre</OPTION>
<option value="Atlantico">Atlantico</OPTION>
</cfselect>
Explanation:
To add a new cfselect just add in the onchange between the "" the
following:
for (var i:Number = 0; i<state.length; i++) {if (state.getItemAt([i]).data
== UsersGrid.selectedItem.state) state.selectedIndex = i} for (var i:Number
= 0; i<meetingtime.length; i++) {if (meetingtime.getItemAt([i]).data ==
UsersGrid.selectedItem.meetingtime) meetingtime.selectedIndex = i}
change the field in this example "state" to your field name.
Watch out for upper and lower case-actionscript is case sensitive although
cf isn´t
Hope that helps someone out there as it was a nightmare for me working it
out!
>From: "Ed Goodson" <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: CF-Talk <[email protected]>
>Subject: Anyone?! Does anybody know about cfforms? Should be simple!
>Date: Mon, 23 Oct 2006 13:56:32 +0000
>
>I can output and change dynamic data in cfforms fine using cfgrid
>and on Change actionscript on cfinputs and cfselects (cfinput like this):
>
><cfinput type="text" name="UPDATED" label="UPDATED"
>bind="{UsersGrid.dataProvider[UsersGrid.selectedIndex]['UPDATED']}"on
>Change="UsersGrid.dataProvider.editField(USersGrid.selectedIndex,
>'UPDATED', UPDATED.text);">
>
>I am just wondering how and if it is possible to output the value
>dynamically as in the code above but without it being a cfinput or
>cfselect field (like a cfoutput which doesn´t work in cfforms format
>flash).
>How would I output the value above? With cfscript and actionscript or do I
>have to make
>the cfinput type="hidden", save the value to a variable and output like
>that? CFScript?
>
>Thanks for any pointers
>
>_________________________________________________________________
>Windows Live Messenger has arrived. Click here to download it for free!
>http://imagine-msn.com/messenger/launch80/?locale=en-gb
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:258698
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4