(Mobile) Triggering an event after everything on the screen is fully rendered

(Mobile) Triggering an event after everything on the screen is fully rendered

  

Hello,

I'm having a problem regarding the manipulation of the DOM with Javascript/JQuery on Outsystems Mobile.

I have a screen with a block inside, from which i want to remove some HTML.

The reason for this is the Outsystems Mobile checkbox apparently gets rendered in the HTML with a <span> tag around it. This is inconvenient because the CSS currently implemented on the project is not prepared for this.

I have the piece of code required for removing the HTML from the DOM and it works since I used the remote devices debugging tool on Chrome and when I run the code on the browser console it indeed removes the desired HTML.

What I assume is happening is that I'm trigerring the event in the wrong place before the page is fully loaded and so it doesn't do anything.

Can someone tell me as to where you would need to run the JS in order to be able to catch the already rendered HTML inside the block?

One would assume it would be on the OnRender Event of the Block since it triggers on the OnAfterFetch of the screen queries so the data would already be on the screen.

Thank you very much in advance!

Hi Joao, 

You can run your javascript on Screen OnReady() event. 

You can create a Client Action on OnReady() which will run a javascript to remove unwanted HTML. 

See the image below: 


Regards,
Palak Patel