Method: ExtNode#remove_childs
- Defined in:
- lib/extjsml/basenode.rb
#remove_childs(xtype, options = {:recursive => 1}) ⇒ Object
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/extjsml/basenode.rb', line 152 def remove_childs(xtype, = {:recursive => 1}) return false unless has_child? opt = if opt[:recursive] opt[:recursive] -= 1 end new_childs = [] childs.each do |c| c.remove_childs xtype if opt[:recursive] > 0 unless c.xtype == xtype new_childs << c end end self.childs = new_childs end |