            (update-data! nil))
          (when new-columns
            (.setColumns grid new-columns)
+           (resizeColumns grid)
            (.render grid))
          (when filter-by
            (.setFilterArgs dataview (clj->js {:query filter-by}))

            grid
            (js/jQuery (str "#" pager-id)))))

(def sg-options
  "Options to feed the slickgrid constructor."
  #js {:autoHeight true

           (go (<! (timeout 20))
               (.resizeCanvas grid)
               (.invalidateAllRows grid)
               (resizeColumns grid)
               (.render grid)
               (init-sg-pager grid dataview))))))))

(defn- render-options
  [options owner colset!]
  (let [choose-display-key (fn [k] (om/set-state! owner :name-or-label k)
                             (colset! k))]
    (for [[k v] options]
      [:li [:a {:on-click (click-fn #(choose-display-key k)) :href "#"} v]])))

