   [data owner]
   "Initializes grid + dataview, and stores them in owner's state."
   (when (seq data)
-    (let [{:keys [flat-form]} (om/get-shared owner)
-          [grid dataview] (sg-init data flat-form)]
+    (let [{:keys [flat-form is-filtered-dataview?]} (om/get-shared owner)
+          [grid dataview] (sg-init data flat-form is-filtered-dataview?)]
       (om/set-state! owner :grid grid)
       (om/set-state! owner :dataview dataview)
       [grid dataview])))

            (do ; data has changed
              (.invalidateAllRows grid)
              (.setItems dataview (clj->js new-data) "_id")
              (.render grid))))))))

       :rowHeight 24
       :enableTextSelectionOnCells true})

(defn sg-init [data form is-filtered-dataview?]
  "Creates a Slick.Grid backed by Slick.Data.DataView from data and fields.
   Most events are handled by slickgrid. On double-click, event is put on chan.
   Returns [grid dataview]."
  (let [columns (flat-form->sg-columns form true nil is-filtered-dataview?) 
        SlickGrid (.. js/Slick -Grid)
        DataView (.. js/Slick -Data -DataView)
        Pager (.. js/Slick -Controls -Pager)
