Can make ui_gauge clickable?
no it isn't. There are no plans to do that.
It is technically possible to add click handlers to any element on dashboard but I'd like to know why a gauge should be clickable cos if there is any adequate reason, probably it would be a standard behavior of the gauge.
in my opinion , I created some project to be use in my family ,so my uncle get trouble about his eyes . i think about Clicking on gauge can be useful prefer to press button.
So with the ui_template
node
<script>
(function(scope) {
const addListeners = function(){
let clickables = $('.clickable')
for(let i = 0;i<clickables.length;++i){
clickables[i].addEventListener('click',(evt) => {
scope.send({payload:evt.currentTarget.getAttribute('node-id'),topic:'dashboard-element-clicked'})
})
}
}
setTimeout(addListeners,100)
})(scope);
</script>
Then add .clickable
class to all elements which you wont to be clickable.
And the output of the ui_template
will give the id of the clicked node
And then at server side you'll need to make some kind of logic which bounds node's id's with the data you need
Thank you so much i appreciate you !
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.