     category: top category
     subcategories: list of subcategories
     data: gene search model
-###
-SelectMult =
-    controller: (args) ->
+
+WORK TO DO:
+- Fix problem with selecting multiple genes from different main categories
+  Currently, if I pick subcategories from say "Adherence", then pick
+  some others from "Autotransporter", the "Adherence" ones will disappear.
+###
+SelectBar =
+    controller: (args) ->
+        self = @
+        @allcategories = {}
+        @createCategories = () ->
+            #console.log(args.categories)
+            listCats = Object.keys(args.categories)
+            for cat in listCats
+                ## boolean for indicating if the category has been selected
+                self.allcategories[cat] = false
+
         @filterCategories = (category, subcategories) ->
             console.log("Filtering for ", category, " genes")
             for row in args.data.rows

                    ])
                    m('.row',
                        m('.col-xs-12',
                            m.component(SelectMult, {
                                category: category
                                subcategories: args.categories[category]
                                data: args.data

        return m("select", {"data-category-id": args.category, \
                            multiple: "multiple", \
                            class: "form-control", \
                            config: SelectBar.config(ctrl, args)}, [
            for subcat, index in args.subcategories
                attrs = {id: "#{index}", value: subcat, title:subcat}
                m('option', attrs, subcat)
