         {{{:keys [num-displayed-records total-page-count]} :paging} :table-page}
         @shared/app-state]
     ;; dataview / grid hookup
-    (bind-external-slick-grid-event-handlers grid external-event-handlers)
+    (bind-external-sg-grid-event-handlers grid grid-event-handlers)
+    (bind-external-sg-grid-dataview-handlers dataview dataview-event-handlers)
+
     (.subscribe (.-onRowCountChanged dataview)
                 (fn [e args]
                   (.updateRowCount grid)

       :rowHeight 40
       :syncColumnCellResize true})

(defn bind-external-slick-grid-event-handlers
  [grid event-handlers]
  (doall
   (for [[handler-key handler-function] event-handlers

               event (aget grid handler-name)]]
     (.subscribe event handler-function))))

(defn bind-external-sg-grid-dataview-handlers
  [dataview event-handlers]
  (doall
    (for [[handler-key handler-function] event-handlers
          :let [handler-name (hyphen->camel-case (name handler-key))
                event (aget dataview handler-name)]]
      (.subscribe event handler-function))))

(defn sg-init
  "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]."
  [data form is-filtered-dataview? {:keys [grid-event-handlers
                                           dataview-event-handlers]}]
  (let [columns (flat-form->sg-columns
                  form true nil :is-filtered-dataview? is-filtered-dataview?)
        SlickGrid (.. js/Slick -Grid)
        DataView (.. js/Slick -Data -DataView)
        dataview (DataView.)
