From 61129291f253d36e3efd31c7d1c836c600a47098 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 22 May 2017 19:47:40 +0800 Subject: [PATCH] add --- bi/base.js | 9 +++++++++ docs/base.js | 9 +++++++++ src/base/list/virtuallist.js | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/bi/base.js b/bi/base.js index b14612763..1e4d9ea34 100644 --- a/bi/base.js +++ b/bi/base.js @@ -15616,8 +15616,17 @@ BI.VirtualList = BI.inherit(BI.Widget, { this.element.scrollTop(o.scrollTop); }, + _clearChildren: function () { + BI.each(this.container._children, function (i, cell) { + cell && cell.el._destroy(); + }); + this.container._children = {}; + this.container.attr("items", []); + }, + restore: function () { this.renderedIndex = -1; + this._clearChildren(); this.cache = {}; }, diff --git a/docs/base.js b/docs/base.js index b14612763..1e4d9ea34 100644 --- a/docs/base.js +++ b/docs/base.js @@ -15616,8 +15616,17 @@ BI.VirtualList = BI.inherit(BI.Widget, { this.element.scrollTop(o.scrollTop); }, + _clearChildren: function () { + BI.each(this.container._children, function (i, cell) { + cell && cell.el._destroy(); + }); + this.container._children = {}; + this.container.attr("items", []); + }, + restore: function () { this.renderedIndex = -1; + this._clearChildren(); this.cache = {}; }, diff --git a/src/base/list/virtuallist.js b/src/base/list/virtuallist.js index 025921ded..e4c7e76cd 100644 --- a/src/base/list/virtuallist.js +++ b/src/base/list/virtuallist.js @@ -159,8 +159,17 @@ BI.VirtualList = BI.inherit(BI.Widget, { this.element.scrollTop(o.scrollTop); }, + _clearChildren: function () { + BI.each(this.container._children, function (i, cell) { + cell && cell.el._destroy(); + }); + this.container._children = {}; + this.container.attr("items", []); + }, + restore: function () { this.renderedIndex = -1; + this._clearChildren(); this.cache = {}; },