Is it possible to DMX - remove element from DOM

I want to remove the element from DOM entirely not just dmx-show / dmx-hide it which only set the element style to display:none.

Something like Vanilla JS’s removeChild() or Jquery’s .remove() .

Yes that is what conditional region is for that generates a dmx-if tag

And indeed removes its contents completely from the DOM and this delivers huge performance improvements as @nshkrsh experienced in his work

2 Likes

Very cool. Looking forward to use it. Cheers :+1::+1:

Its quite easy to use. And the control itself does not require any major memory consumption in terms of showing/hiding multiple dmx-if regions, so you can use it numerous times.
And you can nest it too.

In the project George has mentioned, I am using 10+ conditional regions, inside a repeater.
So if the repeater has 30 rows, the page has 300+ dmx-ifs… but there is no performance hit because of that.
And I save loads of memory by eliminating dynamic content from the page.

3 Likes