-
Notifications
You must be signed in to change notification settings - Fork 52
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
UI Table - Add "Button" column type #1171
Conversation
Note that this PR is related to my other draft PR. Because when you have multiple button columns, it is usefull to know which button (column) has been clicked. So the |
Great idea - given you've done the ground work - I'd be happy to jump in and offer some hands-on assistance? |
I think the checkbox you're seeing is the multi-row selection, which is a built in feature of the table, rather than it being bound to the cell's "type".
To render the label on the button, you should include the relevant text inside the tags, e.g.
Correct, the
Will need to have a hand-on play with this one |
@joepavitt, Now the injected labels are displayed on my buttons: And my output message is being send as expected: For my use case this is working fine now, because I can now delete easily the displayed video recordings from my doorbell. |
BTW from the |
I was just assessing that as you sent that message - my only other thought was having the key you bind to that column as part of the button click event, but that's essentially what you're doing anyway? |
Having a play - I assume you've added a field/property with the "Verwijder" string in the object in order to label the button that way? Trying to think of a situation where users may just want a static string, or even icon - we could evolve this as a follow on so that "Key" becomes "Value" and then the input is a TypedInput. For the "Button" type, we offer "key", "string", "icon"? For all others, just "key"? |
Yes in my case all buttons have the same static label "Verwijder", which I apply via the key of the button column:
A typedinput might indeed be a next step. Or perhaps allow html text? |
As a first iteration for the button - I'm happy with this. I can add some docs for you, and get this merged. I'll then open a follow up issue to consider typed inputs |
Rather than
As the three interactions? |
…date documentation
Have made the above changes, including adding some documentation, also set This is great @bartbutenaers - thanks for the work on this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failing tests run fine locally, so I'll put this down to GH automation oddities - approval from me
@joepavitt, |
Description
I would like to have buttons in a ui-table:
This is what this PR currently produces:
Marking this as a draft, because I am stuck with a number of things:
I have added the button support in the separate UITableCell.vue (because all other types are supported there), but not sure if that is correct because the checkbox type is added in the UITable.vue file. Which I find rather confusing. Would expect the checkbox also to be in the UITableCell.vue file.
When I inject an input message, my values for the button column are not being showed as button labels. I assume that is because my button is in the separate vue file (perhaps related to point 1).
When I click a button, the onButtonClick method is being called. But the emit in that message does not result in an output message being send. I assume that is because my button is in the separate vue file (perhaps related to point 1).
I use the same color as the other types, but it looks rather weird (as you can see in my screenshot). Not sure why the other types look nice with the same classes...
It would be nice if anybody could give me some tips about what I am doing wrong!
BTW I have added a topic to each output message, in order to allow flows to know what is going on in the ui.
I have not updated the documentation yet.
Related Issue(s)
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
area:migration
label