I'm making progress with the basics of uibuilder, but not quite following how to catch changes in "dynamic" data. Let's say I want to catch a value change in the client side jQuery app using the uibuilder pattern:
uibuilder.onChange( 'myState', function(newVal) {
console.info( 'myState changed!' )
console.log( 'myState:' , newVal )
... some cool code ...
})
Is it possible to set the value in a node-red function using something like uibuilder.set('myState','unconfused')
so the the onChange callback above spots changes? Or is that not how dynamic values work? Can I only use the getter and setters within the jQuery side code? So in that case, I would use a Node Red function to set the {key:value}
inside the msg.payload
and then use uibuilder.onChange('msg',callbackFn)
just to get the payload (which means I have to store the previous key:values
in jQuery code to look for changes)?