Memory leaks in the nested kendo.mobile.ui.ListView when data updated via MVVM

2 posts, 0 answers
  1. Vladimir
    Vladimir avatar
    7 posts
    Member since:
    Dec 2012

    Posted 18 Mar 2013 Link to this post

    When a mobile ListView widget is placed into a different widget and data bound to the ListView by MVVM mechanism, while updating the data, memory leaks occurring. If a small piece of data is updated every second, one megabyte of memory leaking every two seconds. I discivered how to fix it. To do this, change the code of the refresh() method as follows:
          if (e.action === "itemchange") {
            data = e.items[0];
            item = $(that.template(data));

            element.find("[data-" + kendo.ns + "uid=" + data.uid + "]").replaceWith(item);

            /* Add this lines */
            if (data.toJSON) {
              data = kendo.observable(data.toJSON());
            }
            /* the end */

            that.trigger("itemChange", {
              item: item,
              data: data,
              ns: ui
            });

            that._style();
            return;
          }
    It is important that the property "uid" of the object "data" being different from the same property of the object e.items[0] contained in the event.
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 19 Mar 2013 Link to this post

    Hello Vladimir,

     
    We are not sure what your scenario exactly is and how the kendo.observable fixes the problem. Could you please elaborate more on the issue? A runnable jsFiddle/jsBin demo will be great.

    Regards,
    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
Back to Top