Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back button #10819

Open
kurch00 opened this issue May 17, 2024 · 4 comments
Open

Back button #10819

kurch00 opened this issue May 17, 2024 · 4 comments
Assignees
Labels
question generic question

Comments

@kurch00
Copy link

kurch00 commented May 17, 2024

I have 3 dashboard states. The first one contains a table that shows all customers. The second (clicking on a row) contains all devices from the selected customer. And the third contains general information about the selected device. How can I create a back button on the third dashboard state to the second dashboard state, but without losing the information, such as all devices from the previously selected customer?

@kurch00 kurch00 added the question generic question label May 17, 2024
@nicovon24
Copy link

That's true, i have a button which executes a history.back() but the update of the last state loses, it's quiet frustating, if anyone know how to keep the state despite the history.back() would be really useful!

@mariezg
Copy link

mariezg commented May 22, 2024

Hi @nicovon24 and @kurch00 , you could follow the tips below to create a dedicated Thingsboard button :

  1. Create a Markdown widget and add the device alias / info in the Data source
  2. In the Appearance Tab of the Widget, activate Use Markdown/HTML value function and use this code as a base :
return '<div class="header" fxLayout="row" fxLayoutAlign="center center" fxLayoutGap="0px">' +

        
        '<div class="button" fxFlex fxLayout="row" fxLayoutAlign="center " style="padding-right: 0px;">' +

             '<button mat-raised-button color="primary" id="close">' +
              '<mat-icon>highlight_off</mat-icon>' +
              'close ' +
            '</button>'
        
        '</div>'
        +
'</div>';
        

Finally in the Action Tab of the Widget add an action "On HTML element Click" with "close" name and enable set entity from widget.

I hope it helps

@kurch00
Copy link
Author

kurch00 commented May 23, 2024

Thank you!! I found another way to make it work too. The idea was to create a menu/header, so I created one and inside the HTML, I put a button with an ID. In the actions feature, I called it using "Update current dashboard state". However, it wasn't working yet. So, at the point where I wanted to go back, I disabled the "Set entity from widget" option, and it worked out!!

tela 1 config tela 1 tela 2 config tela 2 tela 3 config tela 3

@mariezg
Copy link

mariezg commented May 23, 2024

Perfect, @kurch00 happy that it works for you.
You can also inclue the code snippet I gave into your menu if you want :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question generic question
Projects
None yet
Development

No branches or pull requests

4 participants