 (def pager-elem (r/adapt-react-class (aget js/ReactBootstrap "Pagination")))
 
 (defn set-pager-data [sel-page-no]
-  (let [onres (fn[json]
+  (let [mt (.-value (.getElementById js/document "mutationnumber"))
+        v (.-value (.getElementById js/document "dt"))
+        onres (fn[json]
                 (let [dt (getdata json)]
                   (set-key-value :mutations (.-data dt))
                   (set-key-value :total-pages (get-total-rec-no (.-pagesCount dt)))
-
                   (set-key-value :page-location
                                  [render-mutations (get-value! :mutations)])))]
-    (http-get (str "http://localhost:9000/mutations?pageIndex="(dec (get-value! :current-page)) "&pageSize=10")
+    (http-get (get-index-url (get-value! :is-searched-results)
+                             (dec (get-value! :current-page))
+                             mt v)
               onres)))
-
-
 
 (defn pager [value total-rec]
   [pager-elem {:bsSize "large"

(defn cancel [event]
  (secretary/dispatch! "/"))

(defn search [event]
  (let [dt1 (.-value (.getElementById js/document "dt1"))
        dt2 (.-value (.getElementById js/document "dt2"))
        dt  (.-value (.getElementById js/document "dt"))]

    (do (set-key-value :mutations
                       (clj->js
                        (filter-data (get-value! :mutations)
                                     (c/from-string dt1)
                                     (c/from-string dt2) dt)))
        (set-key-value :current-page 1)
        (set-key-value :page-location
                       [render-mutations
                        (get-new-page-data (get-value! :mutations)
                                           (get-value! :current-page))]))))

;; ========================================================================================
;; Add-update-form creation validation


(defroute documents-path1 "/mutations/update/:id" [id]
  (let [onres (fn[json](
                       (set-key-value :villages (getdata json))
                       (set-page! [mutation-update-template id
                                   (first (filter (fn[obj]
                                                    (=(.-id obj) (.parseInt js/window id))) (get-value! :mutations)))])))]
    (http-get "http://localhost:9000/villages" onres)))


(defroute revenue-list "/revenue" []
  )


(defroute "*" []
