This topic is locked
[SOLVED]

 Inline Edit All Records-open to top of page

9/1/2015 7:25:41 PM
PHPRunner General questions
C
chuckbower author

I have been using inlineedit.editallrecs to have some of my inline edit details tables open automatically to edit mode. (Sergei - this is a great feature for my purposes.) However, one behavior I want to modify: when the page is displayed, the browser scrolls down automatically to the inline edit section of the page. What I want it to do is still display the top of the browser page, where my master record is displayed.
I've tried to modify the behavior by embedding some javascript into the bottom of the master record page like this:

echo '<script>window.scrollTo(0, 0);</script>';
I've also tried it by putting it into the bottom of my details table page too. I can View Source and see the javascript embedded in the page. But it doesn't seem to override the behavior. The browser still goes all the way to the bottom of the page to the inline edit section. Does anyone have an idea of how to overcome this behavior?
Chuck

C
chuckbower author 9/2/2015



I have been using inlineedit.editallrecs to have some of my inline edit details tables open automatically to edit mode. (Sergei - this is a great feature for my purposes.) However, one behavior I want to modify: when the page is displayed, the browser scrolls down automatically to the inline edit section of the page. What I want it to do is still display the top of the browser page, where my master record is displayed.
I've tried to modify the behavior by embedding some javascript into the bottom of the master record page like this:

echo '<script>window.scrollTo(0, 0);</script>';
I've also tried it by putting it into the bottom of my details table page too. I can View Source and see the javascript embedded in the page. But it doesn't seem to override the behavior. The browser still goes all the way to the bottom of the page to the inline edit section. Does anyone have an idea of how to overcome this behavior?
Chuck


Ha ha! I figured it out. I was deploying the script as embedded PHP code in the Visual Editor. Once I dropped the script code into the JavaScript OnLoad event, it worked just fine! I put it into the last details table that was displayed.
Chuck