cancel
Showing results for 
Search instead for 
Did you mean: 

How to find out if DOM is ready?

Former Member
0 Kudos

Hello,

How to find out if DOM is ready in UI5? What is the alternate for $("document").ready(function() of jQuery?

Thanks,

Rashmi

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

I had done a mistake. I added the code in onAfterRendering and its working now.

Former Member
0 Kudos

Hello All,

I am using fusion charts in UI5 as Viz & MaKit are not good enough for the requirements I have. Whenever I go to the page where I have charts, on first time there will be no charts & I get the error "#03091456 chart.render() Error >> Unable to find the container DOM element". Second time if I go to that page then the chart is rendering without any error.

So I thought of rendering the charts once the DOM is ready.

It would be helpful if you can suggest me where to add this rendering functionality.

Thanks,

Rashmi

former_member182372
Active Contributor
0 Kudos

no, really, why would you need it? there are plenty of placeholders (init on Core as mentioned by Max, init on componenet, onInit on controllers) you can even use $(document).ready is some rare cases but why would need an alternative to that?

SergioG_TX
Active Contributor
0 Kudos

agree with Max.  Rashmi, what issue are you facing?

maximilian_lenkeit
Participant
0 Kudos

When you develop in "plain UI5", you shouldn't need to worry about when the DOM is ready. Having said this, UI5 doesn't provide any specific API (i.e. callback) that is invoked when the DOM is read, so if you need this, you can use the jQuery API that you already mentioned.

You might also want to look into the init event of the UI5 core: SAPUI5 SDK - Demo Kit

- Max