             [ajax.core :refer [GET POST]]
             [clojure.string :as str]
             [om-bootstrap.button :as b]
+            [om-bootstrap.panel :as p]
+            
   )
   (:import goog.History)
 )

(def jquery (js* "$"))
(defonce app-state (atom  {:leavetypes [] :leavecode "请选择"} ))


(defn OnGetLeaveTypes [response]

   (swap! app-state assoc :leavetypes  response)

   (.log js/console (:leavetypes @app-state)) 

)


  )
)

(defn setdatepickers []
  (map (fn [text]
    (jquery
     (fn []
       (-> (jquery (str "#" (get text "fieldcode")) )
         (.datepicker {})
       )      
     )
    )
    (.log js/console (str "#" (get text "fieldcode") ))        
    )  (get ((keyword (:leavecode @app-state)) (:leavetypes @app-state)) "fields" ) 
  )
)

(defn alertselected [event]
  ;(js/alert (str event  "ClojureScript says 'Boo!'" ))
  (swap! app-state assoc :leavecode  event)

  (jquery
