Creating your own Node - where to add TypedInput on('change') event handlers
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 42/100
- Type d'issue
- Documentation
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- javascript
- Domaine
- documentation
Piste de recherche
Examinez docs/creating-nodes/properties.md dans « Custom edit behavior » ainsi que docs/api/ui/typedInput/index.md autour de « Methods » et « Disable state ». Comparez le moment du change-event de TypedInput documenté avec l’exemple de oneditprepare dans l’issue. Le travail est considéré comme terminé lorsque la documentation explique quand les handlers peuvent appeler les méthodes de TypedInput et inclut un exemple fonctionnel.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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).
- Langage dominant
- JavaScript
- Étoiles
- 118
- Forks
- 161
- Merge moyen
- 8 h 18 min
- PR mergées (30 j)
- 4
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de node-red/node-red.github.io
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 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 Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 62/100
node-red/node-red.github.io#280 · 1 commentaire ·
-
Website updates for Node-RED 5.0 Ouverte
node-red/node-red.github.io#416 · 1 réaction · 1 personne assignée ·
-
Difficulté 1/5 1-3 heures Accessibilité débutants 50/100
node-red/node-red.github.io#384 ·
-
node-red/node-red.github.io#382 · 1 commentaire · 1 personne assignée ·
Toutes les issues de node-red/node-red.github.io
Issues similaires
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
babalae/bettergi-scripts-list#3674 ·
-
ecosystem wording
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
matrix-org/matrix.org#3649 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
vadimdemedes/ink#1029 ·
-
code-quality refactoring
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
langchain-ai/deepagents#6450 ·