# Custom node, dynamic editor by ajax

**URL:** <https://discourse.nodered.org/t/custom-node-dynamic-editor-by-ajax/23625>\
**Category:** General\
**Created:** [25 March 2020 15:08 UTC](https://discourse.nodered.org/t/custom-node-dynamic-editor-by-ajax/23625 "2020-03-25T15:08:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![juncaofish](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juncaofish/32/18815_2.png) [@juncaofish](https://discourse.nodered.org/u/juncaofish)\
**Post date:** [25 March 2020 15:08 UTC](https://discourse.nodered.org/t/custom-node-dynamic-editor-by-ajax/23625/1 "2020-03-25T15:08:01Z")

</div>

Hello, everyone,  
I'd like to create a custom node, with dynamic editor, which changes it's form controls (like dropdown options) with ajax inside. Is it possible to implement within oneditprepare? Or should I use ui dashboard instead?

---

<div class="post-metadata">

**Author:** ![juncaofish](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juncaofish/32/18815_2.png) [@juncaofish](https://discourse.nodered.org/u/juncaofish)\
**Post date:** [25 March 2020 15:14 UTC](https://discourse.nodered.org/t/custom-node-dynamic-editor-by-ajax/23625/2 "2020-03-25T15:14:45Z")

</div>

I go through google and find something very approximate [here](https://apiko.com/blog/node-red-pallets-development/), still unsure of the limit of node editor

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [25 March 2020 15:31 UTC](https://discourse.nodered.org/t/custom-node-dynamic-editor-by-ajax/23625/3 "2020-03-25T15:31:36Z")

</div>

Your `oneditprepare` function can contain whatever javascript you need in order to build the edit dialog. We include jQuery as the utility library of choice.

A lot of the core nodes are examples of building the edit dialogs dynamically - such as the Switch and Change nodes - although none use ajax.

---

<div class="post-metadata">

**Author:** ![juncaofish](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juncaofish/32/18815_2.png) [@juncaofish](https://discourse.nodered.org/u/juncaofish)\
**Post date:** [25 March 2020 15:49 UTC](https://discourse.nodered.org/t/custom-node-dynamic-editor-by-ajax/23625/4 "2020-03-25T15:49:35Z")

</div>

Thanks for your quick response. Sorry if I didn't tell the question clearly.

What I want to implement is like a multi-select form control, which is more dynamic than config properties of subflow. Let's call it a configuable dataset.

- When editing the node, I could change some form control (let's say filter fields), and request data api to populate results for multiple selection.

- The selected results could be passed out on input msg.

This seems to be easy with website client. I don't know if it is suitable or possible to implement in a custom node.

---

<div class="post-metadata">

**Author:** ![juncaofish](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juncaofish/32/18815_2.png) [@juncaofish](https://discourse.nodered.org/u/juncaofish)\
**Post date:** [25 March 2020 16:01 UTC](https://discourse.nodered.org/t/custom-node-dynamic-editor-by-ajax/23625/5 "2020-03-25T16:01:26Z")

</div>

After more searching, I found a [solution](https://discourse.nodered.org/t/show-apis-response-in-node-ui/3424/16) by you earlier which seems to be exactly I want..

Let's make it clear.. the editor dialog is just same with a running web client, and can do whatever I want with a remote server.. right?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 May 2020 16:01 UTC](https://discourse.nodered.org/t/custom-node-dynamic-editor-by-ajax/23625/6 "2020-05-24T16:01:28Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
