# Md-button in DB2

**URL:** https://discourse.nodered.org/t/md-button-in-db2/91317
**Category:** Dashboard
**Tags:** dashboard-2
**Created:** [27 September 2024 22:51 UTC](https://discourse.nodered.org/t/md-button-in-db2/91317 "2024-09-27T22:51:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sanderson](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sanderson](https://discourse.nodered.org/u/sanderson)
#### Post date: [27 September 2024 22:51 UTC](https://discourse.nodered.org/t/md-button-in-db2/91317/1 "2024-09-27T22:51:27Z")

</div>

Hi DB2 guru's,  
I have a question. I have a DB1 button that operates when pressed and held to extend a sofa (while held). It works in a template node. I tried copying the short template node code to DB2, but the button itself does not appear. Can someone suggest a fix, and why? Thanks, and have a good weekend!

```auto
[{"id":"4f90fae40fd8e532","type":"ui-template","z":"5a05b8f3.894b88","group":"9bc03a5c59d9e8a3","page":"","ui":"","name":"49_Sofa Ext","order":1,"width":"3","height":"1","head":"","format":"<style>\n .nr-dashboard-template {\n padding: 0px;\n }\n</style>\n<div class=\"sofa_ext\">\n <md-button style=\"width:100%; height:48px; margin: 0px\">Extend</md-button>\n</div>\n\n<script>\n (function($scope) {\n \n$('.sofa_ext').on('touchstart mousedown', function(e) {\n e.preventDefault(); //prevent default behavior\n $scope.send({\"payload\": \"on\",\"topic\": \"49_state\"});\n});\n\n$('.sofa_ext').on('touchend mouseup', function(e) {\n e.preventDefault(); //prevent default behavior\n $scope.send({\"payload\": \"off\",\"topic\": \"49_state\"});\n});\n \n})(scope);\n</script>","storeOutMessages":true,"passthru":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":370,"y":1920,"wires":[["6d7f464b07ce238d"]]},{"id":"9bc03a5c59d9e8a3","type":"ui-group","name":"Sofa","page":"f73082b0516f3a7e","width":"6","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"f73082b0516f3a7e","type":"ui-page","name":"Sofa, Awning, Generator","ui":"f2eea23e252f30f6","path":"/page6","icon":"home","layout":"grid","theme":"a965ccfef139317a","order":3,"className":"","visible":"true","disabled":"false"},{"id":"f2eea23e252f30f6","type":"ui-base","name":"Dolores DB2","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"showPageTitle":true,"titleBarStyle":"default"},{"id":"a965ccfef139317a","type":"ui-theme","name":"HN Theme","colors":{"surface":"#606060","primary":"#caf0fe","bgPage":"#383838","groupBg":"#4f4f4f","groupOutline":"#ffffff"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px","density":"compact"}}]

```

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [28 September 2024 06:26 UTC](https://discourse.nodered.org/t/md-button-in-db2/91317/2 "2024-09-28T06:26:52Z")

</div>

Hi @sanderson, Dashboard 1.0 was written with AngularJS, which has been replaced with VueJS now.

We now support VueJS, and by default, all components in the Vuetify Widget Library, you can see some more details [here](https://dashboard.flowfuse.com/nodes/widgets/ui-template.html#vuetify-widgets)

The only thing we currently don't support in the _native_ D2.0 button is an event for push down/up being separate, although we do have a [community pull request](https://github.com/FlowFuse/node-red-dashboard/pull/1252) open that is under review. So it shouldn't be more than a week before it is supported, even by the core Button node, so no need for a Template.

---

<div class="post-metadata">

### Author: ![sanderson](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sanderson](https://discourse.nodered.org/u/sanderson)
#### Post date: [28 September 2024 22:27 UTC](https://discourse.nodered.org/t/md-button-in-db2/91317/3 "2024-09-28T22:27:05Z")

</div>

Thanks Joe! Every time I have a DB2 question, the answer comes very quickly. Much appreciated!

---

<div class="post-metadata">

### Author: ![sanderson](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sanderson](https://discourse.nodered.org/u/sanderson)
#### Post date: [23 October 2024 16:26 UTC](https://discourse.nodered.org/t/md-button-in-db2/91317/4 "2024-10-23T16:26:31Z")

</div>

Hi Joe, This works perfectly now! Thank you!

---

<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: [6 November 2024 16:27 UTC](https://discourse.nodered.org/t/md-button-in-db2/91317/5 "2024-11-06T16:27:05Z")

</div>

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