This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-17
Channels
- # announcements (4)
- # beginners (82)
- # boot (1)
- # calva (26)
- # cider (13)
- # clj-kondo (41)
- # cljs-dev (25)
- # cljsrn (7)
- # clojure (82)
- # clojure-berlin (1)
- # clojure-brasil (1)
- # clojure-dev (13)
- # clojure-europe (11)
- # clojure-italy (27)
- # clojure-nl (8)
- # clojure-russia (6)
- # clojure-spec (32)
- # clojure-uk (15)
- # clojurescript (61)
- # core-async (1)
- # cursive (9)
- # data-science (1)
- # datomic (18)
- # duct (1)
- # emacs (2)
- # events (7)
- # fulcro (13)
- # graalvm (5)
- # immutant (1)
- # jobs-discuss (63)
- # leiningen (3)
- # off-topic (48)
- # om (3)
- # pathom (13)
- # planck (20)
- # prelude (3)
- # re-frame (55)
- # reagent (13)
- # reitit (5)
- # rewrite-clj (12)
- # shadow-cljs (67)
- # spacemacs (14)
- # sql (5)
- # tools-deps (4)
- # vim (23)
- # yada (2)
what does this do:
(js/console.log (.getElementById js/document
"alternative-page-datatable"))
“#alternative-page-datatable” but yea, assuming a couple things about your environment
(.DataTable (js/$ “#alternative-page-datatable”) (clj->js {:pagingType “full_numbers” :drawCallback #(js/console.log “hello”)}))
does this work on the page https://clojurians.slack.com/files/UCD54AV63/FKPHJF8VC/-.clj
are you trying to use http://datatables.net?
please add that and show me what https://clojurians.slack.com/files/UCD54AV63/FKPHJF8VC/-.clj outputs
<script src=“js/vendor/jquery.js”></script> <script src=“js/vendor/jquery.dataTables.min.js”></script> <script src=“js/vendor/dataTables.bootstrap4.js”></script> <script src=“js/vendor/dataTables.responsive.min.js”></script> <script src=“js/vendor/responsive.bootstrap4.min.js”></script> <script src=“js/vendor/dataTables.buttons.min.js”></script> <script src=“js/vendor/buttons.bootstrap4.min.js”></script> <script src=“js/vendor/buttons.html5.min.js”></script> <script src=“js/vendor/buttons.flash.min.js”></script> <script src=“js/vendor/buttons.print.min.js”></script> <script src=“js/vendor/dataTables.keyTable.min.js”></script> <script src=“js/vendor/dataTables.select.min.js”></script>
can you tell me what this returns for you in the console document.querySelectorAll('*[id]')
NodeList(32) [link#main-style-container, script#app.min.js, style#--re-frame-10x-key-frames--, style#--re-frame-10x-styles--, body#body, div#app, div#detached-topbar-placeholder, div#vertical-sidebar-placeholder, div#left-side-menu-container.slimscroll-menu, img#side-main-logo, img#side-sm-main-logo, div#detached-sidebar-placeholder, div#vertical-topbar-placeholder, div#horizontal-topbar-placeholder, table#alternative-page-datatable.table.dt-responsive.nowrap, input#light-mode-check.custom-control-input, input#dark-mode-check.custom-control-input, input#vertical-check.custom-control-input, input#horizontal-check.custom-control-input, input#detached-check.custom-control-input, input#fluid-check.custom-control-input, input#boxed-check.custom-control-input, input#default-check.custom-control-input, input#light-check.custom-control-input, input#dark-check.custom-control-input, input#fixed-check.custom-control-input, input#condensed-check.custom-control-input, input#scrollable-check.custom-control-input, button#resetBtn.btn.btn-primary.btn-block, div#--re-frame-10x--, iframe#blockbyte-bs-sidebar.notranslate, div#blockbyte-bs-indicator.blockbyte-bs-fullHeight.blockbyte-bs-visible]
can you tell me what this does in the console? https://clojurians.slack.com/files/UCD54AV63/FKPHJF8VC/-.clj
you need to change your original code to include (js/$ "#alternative-page-datatable")
instead of getElementById
(.DataTable (js/$ “#alternative-page-datatable”) (clj->js {:pagingType “full_numbers” :drawCallback #(js/console.log “hello”)}))
i can help you translate function () {$('.dataTables_paginate > .pagination').addClass('pagination-rounded');}
if you need help
(.DataTable (js/$ “#alternative-page-datatable”) (clj->js {:pagingType “full_numbers” :drawCallback (fn [] (.addClass (js/$ “.dataTables_paginate > .pagination”) ‘pagination-rounded’) )}))
'
and "
are mean different things in clj unlike js, so 'pagination-rounded'
should be "pagination-rounded"