     (reset! order state))
   (sql [_]
     (sql/sql-select @cols @tables @conditions @order @group))
-  (sql-distinct [this col]
+  (sql-distinct [_ col]
     (sql/sql-select [(str "distinct " col)] @tables @conditions [] []))
   (sql-count [_]
     (sql/sql-select ["count(*)"] @tables @conditions [] [])))

        [c/button {:bs-style "default" :on-click #(.filter controller col @condition)}
         "OK"]]])))

(defn column-toolbar [show? i col sort-control controller]
  (let[active-box (atom nil)]
    (fn[show? i col sort-control controller]
      (if @show?
        [:div.my-popover
         [c/button-group {:bsSize "xsmall"}
          [c/button {:on-click #(swap! active-box case :filter nil :filter)} [:i.fa.fa-filter]]
          [c/button {:on-click #(swap! active-box case :distinct nil :distinct) :title "Distinct Values"} [:i.fa.fa-list-alt]]
          [c/button [:i.fa.fa-minus]]
          [c/button [:i.fa.fa-plus]]
          [c/button {:on-click #(.set-sort sort-control i "up") :title "Sort Asc"} [:i.fa.fa-sort-up]]

          [c/button {:on-click #(.set-sort sort-control i nil) :title "No Sort"} [:i.fa.fa-sort]]]
         (case @active-box
           :filter [filter-box col controller]
           :distinct [dist-values col controller]
           [:span])]))))

(defn scroll-bottom? [e]
  (let [elem (.-target e)
