MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    UpdateDom not working

    Development
    3
    22
    7233
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      j.e.f.f Project Sponsor Module Developer @sharmmoh1983 last edited by

      @sharmmoh1983 all the Dom objects for all modules are created automatically when MagicMirror starts. This is not under your control, even for your own module. Your getDom() routine is called when your module’s Dom object is initially created. This is why it is common to see a conditional in getDom() routines that returns something like a simple string (e.g.: “Loading…”). Once your Dom object has been created, you can call updateDom() at your discretion to make changes to whatever your module displays. If you don’t want your module to display anything, then don’t specify a location in the config for your module. If a location is specified, SOMETHING will appear there, even if you don’t have a getDom() routine.

      You can’t make changes to another module’s Dom object, but you can hide or show it. However, you can’t do that until that Dom object is initially created.

      When all the Dom objects for all modules have been created at startup, MagicMirror dispatches the DOM_OBJECTS_CREATED notification. By waiting for this notification, you can be sure that any module you attempt to hide will be hidden.

      1 Reply Last reply Reply Quote 0
      • S
        sharmmoh1983 last edited by

        @j-e-f-f It is kind of working now… I will test it thoroughly for two days and will revert in case of any issue

        @j-e-f-f @Sean thank a lot for your prompt replies and efforts

        1 Reply Last reply Reply Quote 0
        • 1
        • 2
        • 3
        • 3 / 3
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy