This is a migrated thread and some comments may be shown as answers.

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

1 Answer 34 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Vladimir
Top achievements
Rank 1
Vladimir asked on 18 Mar 2013, 04:47 PM
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.

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 19 Mar 2013, 01:23 PM
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!
Tags
ListView (Mobile)
Asked by
Vladimir
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or