Master Detail, when choosing from list, the scroll in detail screen in not on top

a very specific but annoying "bug" - when choosing an item from the list on the left, the scroll on the detail list on the right moves down just by a bit instead of staying all the way up - does anyone know a way to fix this?

close up on the problem itself

thanks in advance

Solution

Hi @CincoMariposas,

Please note the following issues in your code:

1. The Id is case sensitive, so let's change 'b8-splitright' to 'b8-SplitRight'. 

2. You are setting controlId = 0, but as indicated in my original post, please set controlId.scrollTop = 0.

Let's copy and paste the following code into your javascript

var controlId = document.getElementById('b8-SplitRight');

controlId.scrollTop = 0;

Regards

AJ

Solution

Hello @CincoMariposas,

The following works for me. Just add the following 2 lines of code inside a JavaScript widget in the OnListItemClick client action (or the equivalent action in your case):

var controlId= document.getElementById('b2-SplitRight');

controlId.scrollTop = 0;



Hope this helps :)

AJ

Hey AJ, thanks for the help so far.

Sadly this sollution didn't help the problem. when entering the detail-screen a message pops up:


I think that happens, because that class, was not created yet, that's why the Null. 

I think you must make an event listener to see when the right side is created or not. 

What you think @=AJ= ?

Regards,

Márcio C.

Hello @CincoMariposas,

On your Detail screen please right mouse click and choose 'Inspect' as shown in the sample screenshot from my demo screen.

In the Developer's tool window that opens, the element will be automatically highlighted, please check if the name of the 'id' for the highlighted element is 'b2-SplitRight'. 

If the id is different in your code, then please include your Id in the javascript instead and try again.

My demo is a Reactive web app (I believe Traditional web does not have a master detail widget?). I have attached the demo so IF the above step does not help, then you can compare and identify the differences in your set up vs the demo. Also please confirm if the demo works for you as well.

Regards

AJ

DemoMD.oml


Hey @Marcio Carvalho - Let's see if the above steps help the OP. The class should not be a problem since the script is getting the element by Id. At this point I would suggest the OP (original poster) to ensure the right ID is used in the javascript. Fingers crossed :)

Regards

AJ

Hey you guys, sorry for the delay in the response.

Anyways after checking my id was indeed different, so i changed it to b8-splitright, added the JS to the onlistitemclick client action, but now i simply get no response. no comment but the same problem still persists. 

thanks so much for your help so far

Solution

Hi @CincoMariposas,

Please note the following issues in your code:

1. The Id is case sensitive, so let's change 'b8-splitright' to 'b8-SplitRight'. 

2. You are setting controlId = 0, but as indicated in my original post, please set controlId.scrollTop = 0.

Let's copy and paste the following code into your javascript

var controlId = document.getElementById('b8-SplitRight');

controlId.scrollTop = 0;

Regards

AJ

Yes! Problem solved! 

thanks so much for the help!

Awesome! You are very welcome, happy to help,

Regards

AJ

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.