Forum Stats

  • 3,757,803 Users
  • 2,251,268 Discussions
  • 7,869,920 Comments

Discussions

GANTT chart not refreshing properly on APEX 20.1

Simon Collins
Simon Collins Member Posts: 122 Bronze Badge

Hi All

I'm reposting the below on this forum as I tried it on the APEX forum and got no response.

-------

We've noticed that if we try refresh a GANTT type report with a dynamic action to refresh that region the results are strange (when the criteria for rendering the details changes). The region does refresh but often it seems that events that were on the original GANTT before the refresh are left there and overlap with new events that are based on the new criteria. It seems almost like the object is not clearing itself and rendering itself from scratch. If I submit / refresh the page the chart renders itself fine, so I could just get the page to work with making the button submit and not partial refresh but that is clunky.

I'm wondering if anyone else has seen this or knows of any work around, perhaps a js snippet that can also be called via the dynamic action to destroy and re-instantiate the js object before the refresh

We're on 20.1

Thanks

Simon

Answers

  • I'm not exactly sure how APEX is calling a refresh on the Gantt chart, or what triggers the refresh. The refreshing of a region would most likely be a server-side event in APEX itself, while JET isn't going to do anything until a client-side API is called or some is reloaded (like the page reload that you mentioned).

    I don't want to just point you back to the APEX team, but I think the final answer will have to come from them. If you can implement a client-side JavaScript call, the API would as simple as calling .refresh() on the <oj-gantt> DOM element.

    document.getElementById('mygantt').refresh();
    

    It's pretty rare that you would ever need to call refresh though. Something else may be driving the weirdness.

  • Simon Collins
    Simon Collins Member Posts: 122 Bronze Badge

    Hi John

    Thanks for the reply - I know that it was long shot and that the issue is most likely to be resolved by the APEX team.

    A server side refresh always renders the GANTT correctly. The dynamic actions I'm talking about are APEX's way of using ajax to refresh part of the page with a client side call to the database. It seems to work 98% fine but there are oddities when moving date ranges. I've put a few pictures below of a simple 1 line gantt, just in case the specific example highlights anything obvious

    Starting Data - rendering fine (3 tasks against a row)

    Move the date range a week back and client side refresh - chart refreshes and moves dates correctly but loses task information

    Hi F5 on the screen and cause a complete server side refresh everything OK again


    Strange thing is it, for some rows it works fine and at the moment I can't find the pattern,

    ps I can't seem to get your JS snippet to work. Not sure the way APEX implements it prohibits me know what the document element id is - I keep getting errors but I'll keep looking. I also might try and report in the APEX forum


    Thanks


    Simon

  • If you only have the one gantt chart on the page, you may be able to use document.querySelector('oj-gantt') instead of the ID.

  • Simon Collins
    Simon Collins Member Posts: 122 Bronze Badge

    Hi John

    Thanks for the reply. Time constraints have meant that I've had to leave the client side refresh at the moment and stick to what works but I will be come back to it when I have more time to investigate thoroughly and will look at your suggestions

    Thanks again for your input

    Simon