Skip to main content
Participant
November 5, 2018
Question

Setting initial selection in <cfgrid>?

  • November 5, 2018
  • 1 reply
  • 435 views

I am trying unsuccessfully to create a <cfgrid> (ColdFusion 9) with an initial selection and I can't seem to get it to work.  Note this could be none, some, or all of the rows.

There doesn't seem to be an option to easily to this.  I looked at the selectOnLoad attribute, but that will only select the first element.

I then looked at the onload attribute.  I created a JavaScript function but calls to ColdFusion.Grid.getGridObject('mygrid) are returning null in it. It appears that this is still too early in the process (although this seemed like exactly what I wanted).

I then tried registering my own event listener with

     ColdFusion.Event.registerOnLoad(initializeGrid,null,false,true);

This seemed to be better. I could actually select my rows (and see the selection), but they were immediately unselected by what I assume was some sort of refresh at the end of the load. So this is close, but still doesn't seem to happen after the grid is completely loaded.

This seems to be something people would like to do, but I have been unable to find any examples.

Any ideas?

Thanks!

This topic has been closed for replies.

1 reply

WolfShade
Legend
November 6, 2018

Are there any JavaScript errors appearing in the console?  It might be a JS issue.

Just a thought.

V/r,

^ _ ^

oeuftete1Author
Participant
November 6, 2018

Yeah, I checked the console log and saw no JS errors. I should have mentioned that.

WolfShade
Legend
November 6, 2018

Is the project you're working on available to us to view?

V/r,

^ _ ^