Creating your own Node - where to add TypedInput on('change') event handlers
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 42/100
- Issue 類型
- 文件
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- javascript
研究方向
檢查 docs/creating-nodes/properties.md 中的「Custom edit behavior」,以及 docs/api/ui/typedInput/index.md 中「Methods」和「Disable state」附近的內容。比較文件所述的 TypedInput change-event 時機與 issue 中的 oneditprepare 範例。當文件說明 handler 何時可以呼叫 TypedInput 方法,並包含一個可正常運作的範例時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
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).
- 主要語言
- JavaScript
- 星號
- 118
- 分支
- 161
- 平均合併
- 10 小時 37 分鐘
- 30 天內合併 PR
- 3
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
node-red/node-red.github.io 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 68/100
node-red/node-red.github.io#327 ·
-
難度 1/5 1 小時以內 新手友好度 62/100
node-red/node-red.github.io#280 · 1 則留言 ·
-
Website updates for Node-RED 5.0可能重新可做 @knolleary 於 139 天前認領,目前沒有進行中的 PR。 未關閉
node-red/node-red.github.io#416 · 1 個 reaction · 已指派 1 人 ·
-
難度 1/5 1-3 小時 新手友好度 50/100
node-red/node-red.github.io#384 ·
-
Update TypedInput docs for node type filter可能重新可做 @knolleary 於 489 天前認領,目前沒有進行中的 PR。 未關閉
node-red/node-red.github.io#382 · 1 則留言 · 已指派 1 人 ·
查看 node-red/node-red.github.io 的全部 Issue
相似的 Issue
-
ci-install-db-tools stall-case tests flake: stalled apt-get can be killed before it logs its call未關閉effort:low model:light plan planner:opus-5-5 tests
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆
-
Bug 🐞
難度 2/5 1-3 小時 新手友好度 72/100
mozilla-mobile/firefox-ios#35986 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
-
component:sight
難度 2/5 1-3 小時 新手友好度 78/100
agentic-os-org/ANOLISA#6738 · 2 則留言 ·
維護者通常 1 天內回覆
-
bug Durable Agents Observability (AI Telemetry) status: needs triage
難度 2/5 1-3 小時 新手友好度 82/100
mastra-ai/mastra#26470 · 1 則留言 ·
維護者通常 1 天內回覆