     url: () -> "/api/pkgs"
     parse: (response) -> response.groups
 
+    get_filter: () ->
+        @_filter
+
+    set_filter: (filter) ->
+        @_filter = filter
+        @trigger("filter", @_filter)
+
 class PackagesView extends Backbone.View
 
     initialize: (options) ->

    get_active: () ->
        @_active || @get_default()

    get_filter: () ->
        @_filter

    set_active: (name) ->
        @_active = @get_by_name(name)
        @trigger("activate", @_active)

    set_filter: (filter) ->
        @_filter = filter
        @trigger("filter", @_filter)

class EnvsView extends Backbone.View
    initialize: (options) ->

        $headers = $('<tr>').html($('<th>').text(text) for text in headers)

        installed = env.get('installed')
        filter = @pkgs.get_filter()

        $rows = for pkg in @pkgs.models
            name = pkg.get('name')
