     @table.refresh()
 
    apply: ->
+    try
+     text = @func
+     coffee = CoffeeScript.compile "return (#{text})"
+     func = new Function "return #{coffee}"
+     func = func()
+    catch e
+     func = -> false
+
+    deleteRows = {}
+    for r in [0...@table.size]
+     args = (@table.data[id][r] for id of @search)
+     result = func.apply null, args
+     if result? and result isnt false
+      if result.delete
+       deleteRows[r] = true
+      else if result.replace?
+       c = 0
+       for id of @search
+        @table.data[id][r] = result.replace[c]
+        ++c
+
+    for id, data of @table.data
+     @table.data[id] = (d for d, r in data when not deleteRows[r])
+     @table.size = @table.data[id].length
+
 
 
 

      @$.elems.func = @textarea "#search-func.u-full-width",
       value: '-> false'
       on: {change: @$.on.change}
     @button '.u-full-width', on: {click: @$.on.cancel}, 'Cancel'

    @_setData() if @table?

    highlight = (true for i in [0...@table.size])
    for r in [0...@table.size]
     args = (@table.data[id][r] for id of @search)
     result = func.apply null, args
     if result? and result isnt false
      highlight[r] = true
     else
      highlight[r] = false
