From 4752732bf8a7df0b3c4d2fc47141b2b063923c8f Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 21 Oct 2015 14:03:23 +0300 Subject: [PATCH] helper to clear the view --- lib/base/list_view.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/base/list_view.rb b/lib/base/list_view.rb index 78b9453..c5e417e 100644 --- a/lib/base/list_view.rb +++ b/lib/base/list_view.rb @@ -52,6 +52,11 @@ class ListView < ElementView element.remove end + # remove all elements and views, basically resetting the list to empty + def clear_view + remove_first while( ! @children.empty? ) + end + # append a View instnace to the children array # render it and append it to the html element # and keep a copy in @elements