So...
I am working on a MASSIVE refactor, and want to ensure I use API's that are designed for custom nodes.
to date, I use:
My custom tab opens up jQuery dialogs, but I am always cautions, if this is frowned upon?
So...My questions are:
Is it 'bad practice' for one to open a jQuery dialog from a custom tab?
If it is
is RED.tray a public API? (if so, is there any documentation)
The module I am referring to, is for z-wave - and its extremely complex and fully featured.
and really has 2 parts.
Events, Updates, Reactive automation (where flows are in use)
Network management (adding, removing, configuring devices and the network as a whole)
And its the 2nd point, that requires such a fruitful UI (there are lots of network management areas).
Marcus
marcus-j-davies:
RED.tray
I don't think it is documented. The only place I think it might be used (other than in core programming) is in the Blockly node.
Generally better to use RED.notify
I think - also not really documented I don't believe but certainly in use in a number of core and contributed nodes.
* limitations under the License.
**/
RED.notifications = (function() {
/*
If RED.notifications.hide is set to true, all notifications will be hidden.
This is to help with UI testing in certain cases and not intended for the
end-user.
// Example usage for a modal dialog with buttons
var myNotification = RED.notify("This is the message to display",{
modal: true,
fixed: true,
type: 'warning', // 'compact', 'success', 'warning', 'error'
buttons: [
{
text: "cancel",
click: function(e) {
myNotification.close();
}
},
2 Likes
TotallyInformation:
RED.notify
The notify API wont fit an entire UI . - hence the need for a dialog window approach.
The Network side of Z-Wave - is very involved, so I use modals to present the UI.
This is not not to be confused with general flow development (the network side is not involved with every day flow interaction)
The UI (sidebar + Modal windows) - is to manage the network only
The side panel lists devices / and basic controller info - then the dialogs reveal all the advanced areas
EDIT:
The side panel is occupied quite a bit - hence the more advanced areas in a dialog/modal window
RED.notify
is documented: RED.notify : Node-RED
I don't have a strong opinion on whether using tray or dialog is better.
RED.tray
is available to use, will look at adding docs for it.
There are a few examples in the editor src you could crib from for now: node-red/packages/node_modules/@node-red/editor-client/src/js/ui at master · node-red/node-red · GitHub
1 Like
This at least fills me with confidence its not 'not right'
Thanks @TotallyInformation @knolleary .
2 Likes
system
Closed
3 February 2023 23:16
6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.