i need to load a checkbox dynamically and set its state based on some value….
This is what i have done so far…
(defsnippet customer-config-setup html-customer-configuration [:div#div_game_setup_container ]
[result-rows]
[:div#div_gameprefix]
(clone-for [idv (map vector (iterate inc 0) result-rows)]
[:button#btn_gameprefix ]
(do->
#(if (= (result-rows :active) 0)
((set-attr :checked :val )%)%)
(content (str ((idv 1) :gameprefix )))
)
)
)
and also
(defsnippet customer-config-approval html-customer-configuration [:div#div_auto_approval ]
[result-rows]
[:tr#tr_auto_approval]
(clone-for [idv (map vector (iterate inc 0) result-rows)]
[:td#td_auto_approvaltext ] (content (str ((idv 1) :settings_caption )))
[:td#td_auto_checkbox ] (set-attr :checked :val )
)
)
but for some reason they don’t work… what could be the problem…. and is there a way to set checkbox state here…..?
Thank you..
Sorry i had missed out something..
adding
(((idv 1))while getting values here is necessary… i really don’t have enough time to dig up and find a reason why is that even required… because thislibrary/clojureis so low on resources and tutorials it becomes hard find a reason for such things…