Skip to main content
Participant
February 3, 2008
Question

Updating CFGrid using cfquery

  • February 3, 2008
  • 1 reply
  • 261 views


Hello,
I am trying to have a dynamic cfgrid that changes content based on a form button click.

Here's what i am trying to do:

I have a cfquery defined and this is bind to the cfgrid
<cfquery name="GetParks" ..>
SQL QUERY
</cfquery>

<cfgrid name="listingGrid" query="GetParks" rowheaders="false" maxRows="50" height=480 selectMode="EDIT">


All is well so far. In the same uber-form is contained a button with a onclick function
<cfformgroup type="horizontal" style="horizontalAlign:center">
<cfinput type="button" name="submit" value="Update Screen" onclick="submitSearch()" />

In submitSearch() function, I am trying to create a new query and assigning the output to cfgrid to update:
function submitSearch():Void
{
var listingGrid:mx.controls.DataGrid = listingGrid;
<cfquery name="updatequery"> ... </cfquery>

listingGrid = ***HOW DO I ASSIGN THE OF THE NEW updatequery **?
}

Thanks in advance,
This topic has been closed for replies.

1 reply

bizgeneAuthor
Participant
February 3, 2008
Sorry, I see that all my code snippets have been html escaped to quote etc.

In essence, I defined a query, then bind it to a cfgrid. The data shows up okay. Next I wanted to add a button which when clicked refreshes the grid with output from a modified query.

In order to achive that, I defined a new query in the function being called on click, but I am stuck with how to assign the output of the query back to the cfgrid.

listingGrid = what do i put here? just putting queryname or something else doesnt seem to work.
Thnx,.