Skip to content

Files

Latest commit

 

History

History
 
 

select2

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

cljsjs/select2

[cljsjs/select2 "4.0.3-1"] ;; latest release

This jar comes with deps.cljs as used by the Foreign Libs feature of the ClojureScript compiler. After adding the above dependency to your project you can require the packaged library like so:

(ns application.core
  (:require [cljsjs.select2]))

Example:

index.html

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
        <link rel="stylesheet" type="text/css" href="resources/select2.css">
    </head>
    <body>
      <div class="container">
        <select class="js-states form-control">
          <optgroup label="Alaskan/Hawaiian Time Zone">
            <option value="AK">Alaska</option>
            <option value="HI">Hawaii</option>
          </optgroup>
          <optgroup label="Pacific Time Zone">
            <option value="CA">California</option>
            ...
          </optgroup>
        </select>

      </div>
      <script src="out/select2_example.js" type="text/javascript"></script>
    </body>
</html>

select2_example.cljs

(ns select2-example.core
  (:require [cljsjs.select2]))

(.select2 (js/$ ".js-states"))