# Is it OK to use RED.editor.registerTypeEditor

**URL:** <https://discourse.nodered.org/t/is-it-ok-to-use-red-editor-registertypeeditor/77236>\
**Category:** Feature Requests\
**Tags:** documentation\
**Created:** [4 April 2023 09:27 UTC](https://discourse.nodered.org/t/is-it-ok-to-use-red-editor-registertypeeditor/77236 "2023-04-04T09:27:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chudesno](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chudesno/32/47433_2.png) [@chudesno](https://discourse.nodered.org/u/chudesno)\
**Post date:** [4 April 2023 09:27 UTC](https://discourse.nodered.org/t/is-it-ok-to-use-red-editor-registertypeeditor/77236/1 "2023-04-04T09:27:11Z")

</div>

Hi!

## Documentation does not mention `RED.editor.*` APIs of the client. I wonder if it is fine to use them or if they are not a part of public APIs.

I am implementing a custom node managing a somewhat complex data structure: a list of items where each item have another list as its field, i.e:

```auto
const list = [
  { 
    name: 'foo'
    values: [
      { value: 1, unit: 'm' },
      { value: 2, unit: 'f' }
  ]}
]

```

I tried using nested `editableList` and not really satisfied with resulting UX.

I want to try using a separate editor dialog for nested list. I plan on rendering a button per item in node edit dialog per list item. When clicked, editor dialog gets replaced with a custom editor dialog for that particular item.

* * *

Could you, please, advise whether using `RED.editor.*` APIs is safe or if there is any alternative implementation path here?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [4 April 2023 09:52 UTC](https://discourse.nodered.org/t/is-it-ok-to-use-red-editor-registertypeeditor/77236/2 "2023-04-04T09:52:16Z")

</div>

Hi @chudesno - Welcome to the forums

> Could you, please, advise whether using `RED.editor.*` APIs is safe or if there is any alternative implementation path here?

I'm not sure what the answer here is, but IF the undocumented editor API's are not suitable for custom node use, you can still achieve customisation on the UX, by using JQUI Dialog.

> I want to try using a separate editor dialog for nested list

Use the `editableList`, and include a button, for each item.  
On its click - use the JQUI Dialog methods.

[Dialog | jQuery UI](https://jqueryui.com/dialog/)

i use this on my Side bar to open up some advanced network operations in a Dialog.

```auto
const Settings = {
			title: 'Network Management',
			modal: true,
			width: modalWidth,
			height: modalHeight,
			maxWidth: maxModalWidth,
			resizable: true,
			draggable: true,
			close: function () {
				// Cleanup
			}
		}

$('#zwjs-advanced-editor').dialog(Settings);

```

this will allow some bespoke UX handling for your complex structures

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/31ad4c0aaba2bff562eae1de086dc736f0a320c9.png)

This is just my approach, when dealing with complex configurations - many other ways of course

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [4 April 2023 13:47 UTC](https://discourse.nodered.org/t/is-it-ok-to-use-red-editor-registertypeeditor/77236/3 "2023-04-04T13:47:36Z")

</div>

> [@chudesno](#):
>
> Documentation does not mention `RED.editor.*` APIs of the client. I wonder if it is fine to use them or if they are not a part of public APIs.

The "rule" from the core devs has always been that if an API isn't documented, it shouldn't be used since it could easily change or go away.

* * *

Having said that, I do have `RED.editor.createEditor` and `RED.editor.editText` in uibuilder for the file editor. However, that code really should be looked at as I'm not convinced it is current best practice.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [4 April 2023 13:57 UTC](https://discourse.nodered.org/t/is-it-ok-to-use-red-editor-registertypeeditor/77236/4 "2023-04-04T13:57:30Z")

</div>

> [@TotallyInformation](#):
>
> The "rule" from the core devs has always been that if an API isn't documented, it shouldn't be used since it could easily change or go away.

I'm even cautious about using documented ones 😂

---

<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:** [5 April 2023 15:49 UTC](https://discourse.nodered.org/t/is-it-ok-to-use-red-editor-registertypeeditor/77236/5 "2023-04-05T15:49:48Z")

</div>

`registerTypeEditor` only really makes sense if it is an editor you want to reuse in multiple places.

You can use the APIs available to open a second edit tray (as the internals calls them) with whatever content you want. I don't have a ready made example for you, but it's basically a slightly lower level API than the registerTypeEditor one.

I'm away from my laptop this week for some much needed downtime. If you get stuck ping me and I can try to point to an useful places in the code to look, but a more complete response will have to wait until next week.

---

<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:** [4 June 2023 15:49 UTC](https://discourse.nodered.org/t/is-it-ok-to-use-red-editor-registertypeeditor/77236/6 "2023-06-04T15:49:53Z")

</div>

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