       extra-field
       (conj extra-field forms/submission-time-field))))
 
-(defn all-fields [form & {:keys [is-filtered-dataview?]}]
+(defn all-fields
   "Given a (flat-)form, returns fields for table display.
    Puts extra fields in the beginning, metadata at the end of the table,
    and drops fields that have no data (eg. group/note)."
+  [form & {:keys [is-filtered-dataview?]}]
   (->> (concat (get-extra-fields is-filtered-dataview?)
                (forms/non-meta-fields form)
                (forms/meta-fields form :with-submission-details? (not is-filtered-dataview?)))

;; EVENT LOOPS

(defn handle-table-events
  [app-state grid dataview]
  "Event loop for the table view. Processes a tap of share/event-chan,
   and updates app-state/dataview/grid as needed."
  (let [event-chan (shared/event-tap)]
    (go
     (while true


;; SLICKGRID HELPER FUNCTIONS

(defn compfn
  "Comparator function for the slickgrid dataview.
   args.sortCol is the column being sorted, a and b are rows to compare.
   Claims a is bigger (return 1) if value for a > b, or a is null / empty."
  [args]
  (fn [a b]
    (let [col (aget args "sortCol")
          lower #(if (string? %) (clojure.string/lower-case %) %)
