This topic is locked

Making a list automatically scroll to top when displaying and using pageObj.inlineEdit.editAllRecs()

9/15/2022 10:15:41 PM
PHPRunner General questions
C
chuckbower author

For a list page, I want to automatically put all items into edit mode. I use pageObj.inlineEdit.editAllRecs() function in JavaScript OnLoad event for list page. This works great, and puts all list rows automatically in inline Edit mode.

However, I'd also like the list to automatically position to the top items (it scrolls beyond the viewable screen). However, my app positions to the end of the list, not the top.

I've used the code below in past versions of PHPR (v8 & 9, before Page Designer) in Edit page JavaScript OnLoad event, and it always worked well:
window.scrollTo(0, 0);
$('html,body').scrollTop(0);

Instead, I tried the above in my List page JavaScript OnLoad event, and it positioned the window in the middle of the list page rows, but not at the top.

I am using 10.8 build 39787. I've cleared cache. I checked the page with F12 (Chrome) and Console shows no page errors. I am using Chrome, latest version.

Does anyone use the above code to position to the top of the list? (with pageObj.inlineEdit.editAllRecs()???)

Thanks in advance, Chuck

M
Mark Kramer 9/16/2022

Not totaly your answer but I have found that sometimes I have to do an "Upload all files" to get something to work. I've went as far as deleting every file in the hosting folder online. I 'm pretty sure that there are caches on the hosting servers that need to be refreshed periodically and only change when the file is marked as a "new file" upload . Otherwise it keeps thinking that nothing has changed. You know how it is when you know the code is right and nothing seems to make a difference what you change locally, those are the times .

Not Gosple just a Theory that seems to work a lot of the time.

Good luck!
mk

C
chuckbower author 9/19/2022

Thanks for the suggestion. Let's hope I don't have to do that very much.

In either case, it still doesn't work. I started with the code in the Edit page JavaScript event. Put me in the bottom of the web pages. No JS errors in the console.

Tried it on the List page JavaScript event and didn't work there either...

This is a prototype app, just testing out PageDesigner. I added another table with the default page designer settings (not advanced grid) and it also doesn't work on this table, either.

Well, back to the drawing board, or my app doesn't have this features as it used too.

Chuck