Creating your own Node - where to add TypedInput on('change') event handlers
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- documentation
Direzione di ricerca
Rivedi docs/creating-nodes/properties.md alla sezione “Custom edit behavior” e docs/api/ui/typedInput/index.md nelle sezioni “Methods” e “Disable state”. Confronta la tempistica del change-event di TypedInput documentata con l’esempio di oneditprepare nell’issue. Il lavoro è completato quando la documentazione spiega quando gli handler possono chiamare i metodi di TypedInput e include un esempio funzionante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This issue is to suggest a couple of areas where documentation could be improved. Documentation is otherwise very good.
I haven't been able to find documentation for when in time to add a function to watch for change events as documented here. For example, to show/hide or enable/disable an HTML element based on a value of one of the Node properties.
Adding this within oneditprepare does not work ...
$('#node-input-instruction').on('change', (event, type, value) => {
if (value === 'turn_on') {
$('#node-wrapper-speed').typedInput('enable');
$('#node-wrapper-timeout').typedInput('enable');
} else if (value === 'turn_off') {
$('#node-wrapper-speed').typedInput('disable');
$('#node-wrapper-timeout').typedInput('disable');
}
});
... because you get an error since you can't call the typedInput function this early. Is there an official/recommended callback we should be using for once the UI has been setup (added to the DOM, or whaterver work you do)? In the meantime, I am setting hide/show directly on various elements, rather than using typedInput().
Can the documentation in Node Properties and/or TypedInput Widget be updated to make this easier to understand, to provide examples of method calls? Or maybe I've just missed something in the documentation.
If I am confused, maybe others are as well (or maybe they are better at reading documentation).
- Lingua principale
- JavaScript
- Stelle
- 118
- Fork
- 161
- Merge medio
- 8h 18m
- PR unite (30g)
- 4
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di node-red/node-red.github.io
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
node-red/node-red.github.io#327 ·
-
docs/getting-started/local.md: npm command line is now deprecated, use --location=global not -g Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
node-red/node-red.github.io#280 · 1 commento ·
-
node-red/node-red.github.io#416 · 1 reazione · 1 assegnatario ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 50/100
node-red/node-red.github.io#384 ·
-
node-red/node-red.github.io#382 · 1 commento · 1 assegnatario ·
Tutte le issue di node-red/node-red.github.io
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
web-platform-tests/interop#1455 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
corsairdev/corsair#1764 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100