RadDock myportal example ugly DOM

2 posts, 0 answers
  1. jose luis
    jose luis avatar
    20 posts
    Member since:
    Apr 2011

    Posted 25 Aug 2011 Link to this post

    hi i have been studying this example of dynamic raddock with usercontrols.
    What i found is that after you play almost 30 seconds creating and closing docks the html Dom is a complete dissaster, full of divs left by the raddock windows.

    there is a way to clean this dom, for example using a server side event for the close command to unload the control and have a clean DOM?
    i found a little bit complicated because there should be only one close event function for all raddocks so posible you should pass the control loaded in any way to this event handler to know which control you should unload, and in that case i have not clear that could be keep clean.

    Thanks a lot.
  2. Slav
    Slav avatar
    1359 posts

    Posted 31 Aug 2011 Link to this post

    Hello Jose,

    The described behavior is examined because in the My Portal online demo a hidden UpdatePanel is used in order to help with saving state when minimizing, moving and closing docks. As a result the docking zones are not updated and the HTML elements of the RadDocks are persisted on the page.

    If you want to clear the remaining divs, you can utilize only one UpdatePanel, wrapping the RadDockZones, and attach the AsyncPostBackTriggers in the code-behind to this update panel. This way the empty elements, left by the RadDocks, will be cleared when the docks are closed. In order to achieve this, also a new Ajax request will have to be send, for example you can add a new dock, because when a RadDock is closed, its Closed property is set to true, but on Page.Init the old ViewState is preserved and the RadDock is recreated.

    I hope the provided solution helps. Don't hesitate to contact us again should you encounter more difficulties.

    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top