• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 706
  • Last Modified:

cfgrid and cfwindow

Hello,
I'm trying to build an application similar to the one that is posted here:
http://www.brianflove.com/public/cfwindow/

Basically, this is the issue my application and this application are having:
1. Select a row in the grid
2. The window opens
3. Close the window
4. Try to select the same row already selected, to open the window again.  The window wont open unless you click on another row and go back to the previous row.

How can I make the window open again without having to select another row?

The application is using this piece of code to call the function that opens the window:
<cfajaxproxy bind="javascript:todetail({maingrid.id@change},{maingrid.firstname@none},{maingrid.lastname@none})" />

todetail is the JS function. maingrid is the grid's name. and the id is being passed to the function on change.

I on the other hand, am using   <cfajaxproxy bind="javascript:getDetails({files.id@click})" />
@click and still that doesn't work for me.

Any ideas?

Thank you!



0
HumanScaleDev
Asked:
HumanScaleDev
  • 2
1 Solution
 
enriquecadalsoCommented:
Have you tried to use an onFocus event instead of onChange?
0
 
HumanScaleDevAuthor Commented:
Hi Enrique,

I tried @click and onFocus and it didn't work. It seems like it doesn't want to call the JS function more than once when the binding has occurred.

I guess the question is, how can I call a function more than once when using cfajaxproxy bind ? Once the user clicks on a row it calls the function but it won't work again unless you click on another row first.
0
 
HumanScaleDevAuthor Commented:
I found the solution at Raymond Camdem Coldfusion Blog: See post 25 & 34.
http://www.coldfusionjedi.com/index.cfm/2007/8/9/Reacting-to-grid-row-selection

Add this to the JS function, that will unselect the row, allowing the user to select the same row again and open the same cfwindow. :)

mygrid = ColdFusion.Grid.getGridObject(gridname);
sm = mygrid.getSelectionModel()
sm.clearSelections(false);
ColdFusion.objectCache[gridname].selectedRow=-1;
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now