def grid_filter(grid, filter_key)
      unless grid.is_a? WiceGrid
        raise WiceGridArgumentError.new('grid_filter: the parameter must be a WiceGrid instance.')
      end
      if grid.output_buffer.nil?
        raise WiceGridArgumentError.new("grid_filter: You have attempted to run 'grid_filter' before 'grid'. Read about detached filters in the documentation.")
      end
      if grid.output_buffer == true
        raise WiceGridArgumentError.new('grid_filter: You have defined no detached filters, or you try use detached filters with' \
          ':show_filters => :no (set :show_filters to :always in this case). Read about detached filters in the documentation.')
      end

      content_tag :span,
                  grid.output_buffer.filter_for(filter_key),
                  class: "wg-detached-filter #{grid.name}_detached_filter",
                  'data-grid-name' => grid.name
    end
def grid_filter(grid, filter_key)
      unless grid.is_a? WiceGrid
        raise WiceGridArgumentError.new('grid_filter: the parameter must be a WiceGrid instance.')
      end
      if grid.output_buffer.nil?
        raise WiceGridArgumentError.new("grid_filter: You have attempted to run 'grid_filter' before 'grid'. Read about detached filters in the documentation.")
      end
      if grid.output_buffer == true
        raise WiceGridArgumentError.new('grid_filter: You have defined no detached filters, or you try use detached filters with' \
          ':show_filters => :no (set :show_filters to :always in this case). Read about detached filters in the documentation.')
      end

      content_tag :span,
                  grid.output_buffer.filter_for(filter_key),
                  class: "wg-detached-filter #{grid.name}_detached_filter",
                  'data-grid-name' => grid.name
    end
Renders a detached filter. The parameters are:
 * +grid+ the WiceGrid object
 * +filter_key+ an identifier of the filter specified in the column declaration by parameter +:detach_with_id+