Created
November 20, 2020 17:48
-
-
Save geraldodev/be8fb754019dc3e633b67dea5db6ff6c to your computer and use it in GitHub Desktop.
mui Autocomplete with helix. The render-input node needs to be created with plain react
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns app.ui.contratualizacao.regra | |
(:require | |
["@material-ui/lab/Autocomplete" :default Autocomplete] | |
["@material-ui/core/TextField" :default TextField] | |
["react" :as r] | |
[goog.object :as gobj] | |
)) | |
($ ^:native | |
Autocomplete | |
{:id "grupofiltro" | |
:options (or grupos-json #js []) | |
:get-option-label #(gobj/get % "descricao") | |
:get-option-selected #(gobj/get % "codigo") | |
:style {:width 300} | |
:render-input (fn [params] | |
(.createElement r TextField | |
(doto (js/Object.assign #js {} params) | |
(gobj/set "label" "Escolha um grupo") | |
(gobj/set "variant" "outlined") | |
(gobj/set "fullWidth" true)))) }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
($ AutocompleteHelix {:id "mylookup" :js-options #js [{:name "john" :id "1"}] :label "Client" :label-field :name :value-field :id :value simple-cljs-variable-that-has-the-id-of-the-client :on-change (fn [e value reason] (setter-from-helix-use-state-hook assoc :client-id value)) :style {:width "200px"})