Highlighted

Why does page automatically scrolls to cfgrid

Community Beginner ,
Dec 11, 2014

Copy link to clipboard

Copied

I have a page that is tall enough that it scrolls vertically. When it finishes loading, the browser automatically scrolls to the bottom of the page where a cfgrid element lives. It happens in IE, Chrome and Firefox.

I've narrowed the cause down to the JavaScript that the ColdFusion 11 server adds to the top of the page. If I disable scripts in the browser, the page doesn't automatically scroll to the bottom.

Adding window.scrollTo(0,0) to the body onload doesn't work. Whatever JS is scrolling to the bottom happens after the onload event. I haven't tried jQuery's .ready() yet; hoping there is a fix.

Has anyone else seen this and know of a fix or workaround?

Community Beginner
Correct answer by JWogan | Community Beginner

I found that the solution is to add the attribute selectOnLoad="false" to the cfgrid tag. Its default value in CF11 is "true". I'm not sure about CF10, but in CF9 is seems to default to "false".

Views

225

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Why does page automatically scrolls to cfgrid

Community Beginner ,
Dec 11, 2014

Copy link to clipboard

Copied

I have a page that is tall enough that it scrolls vertically. When it finishes loading, the browser automatically scrolls to the bottom of the page where a cfgrid element lives. It happens in IE, Chrome and Firefox.

I've narrowed the cause down to the JavaScript that the ColdFusion 11 server adds to the top of the page. If I disable scripts in the browser, the page doesn't automatically scroll to the bottom.

Adding window.scrollTo(0,0) to the body onload doesn't work. Whatever JS is scrolling to the bottom happens after the onload event. I haven't tried jQuery's .ready() yet; hoping there is a fix.

Has anyone else seen this and know of a fix or workaround?

Community Beginner
Correct answer by JWogan | Community Beginner

I found that the solution is to add the attribute selectOnLoad="false" to the cfgrid tag. Its default value in CF11 is "true". I'm not sure about CF10, but in CF9 is seems to default to "false".

Views

226

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 11, 2014 0
Community Beginner ,
Dec 15, 2014

Copy link to clipboard

Copied

I found that the solution is to add the attribute selectOnLoad="false" to the cfgrid tag. Its default value in CF11 is "true". I'm not sure about CF10, but in CF9 is seems to default to "false".

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 15, 2014 0
BKBK LATEST
Adobe Community Professional ,
Dec 16, 2014

Copy link to clipboard

Copied

Thank you for sharing.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 16, 2014 0