Splitter script error on window resize on IE 9 - when splitter is removed from DOM and added again dynamically

2 posts, 1 answers
  1. Shravan
    Shravan avatar
    1 posts
    Member since:
    Aug 2013

    Posted 11 Oct 2013 Link to this post


    In a MVC4 application I am working, I have some menu links, clicking on these links, I load the relevant page as an ajax partial view below the menu links.
    One of the partial views contains a splitter. When I load this  partial view containing splitter and navigate to other partial views clicking on other links, and if I come back to the view with the splitter partial view - on window resize the scripts throw an error saying that 'offsetWidth' is null. This happens on IE 9.0 only

    Browser: IE 9.0
    Kendo Version: 2013.2.918.340

    I have put up a simple mvc4 application demonstrating that.
    Steps to reproduce :
    1) Click on the link 'Load splitter view below' (Loads a view with splitter beneath the link)
    2) Click on the link 'Load non splitter view below' (Replaces the splitter view with a non splitter view)
    3) Click on the link 'Load splitter view below' (Loads the splitter view again)
    4) Resize the browser window, then the script breaks saying 'offsetWidth' is null. Resizing the window is triggering resize event on splitter, where it is breaking

    Can you please see if this is a real issue or if I am missing out anything here ?
  2. Answer
    Dimo avatar
    8318 posts

    Posted 11 Oct 2013 Link to this post

    Hello Shravan,

    For some reason I am not able to run your project due to missing references, but I got the idea by looking at the code.

    It is important to destroy all Kendo UI widgets in a container, which will be removed or its content will be replaced. Otherwise existing event handlers may cause unexpected side effects, and/or you can have memory leaks

    Splitter destroy:

    Kendo destroy:

    The first method may be sufficient, but I recommend you to use the second one, which will destroy all Kendo UI widget instances found inside the specified container.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top