                event (aget grid handler-name)]]
      (.subscribe event handler-function))))
 
-(defn sg-init
+(defn sg-init [data form is-filtered-dataview?
+               & {:keys [page-count]}]
   "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]."

        SlickGrid (.. js/Slick -Grid)
        DataView (.. js/Slick -Data -DataView)
        dataview (DataView.)
        grid (SlickGrid. (str "#" table-id) dataview columns sg-options)]
    ;; dataview / grid hookup
    (bind-external-slick-grid-event-handlers grid external-event-handlers)
    (.subscribe (.-onRowCountChanged dataview)

         :name label :toolTip label :sortable true
         :formatter (partial formatter field language)})))))

(defn- init-sg-pager [grid dataview & {:keys [page-count]}]
  (let [Pager (.. js/Slick -Controls -Pager)
        pager (Pager. dataview
                      grid
                      (js/jQuery (str "#" pager-id))
                      #js {:totalDisplayPages page-count})]
    pager))

(def sg-options
  "Options to feed the slickgrid constructor."
