I have a List Screen. I would like users to be able to edit the data cells within the List Screen (ie not select a row and navigate to an Edit Screeen for the selected row).
For each row in the List Screen, I would like the data cells to default to NOT editable. Each row will have an Edit button as a default when the List Screen loads. If a user wants to edit the data cells for a particular row, then they will need to click the Edit button for a specific row, which will allow them to do the edit for the row on the List Screen. This will provide control to editing only one row at a time.
When the edit button for a selected row is clicked, then an automation would do the following
#1 Change the data cells for the selected row into "editable" so the user has the option to make changes for the data cells in that row. Ideally you would be able to only make the data cells you permit to be edited in that row, not all cells in the row.
#2 The Edit Button is no longer visible. Instead two additional buttons become visible for that specific row - a Cancel Button and a Save Button
If the now visible Cancel Button is clicked, the following automation occurs
#1 The data cells in the selected row return to non-editable
#2 Both the Cancel and Save Buttons become non-visible and the Edit button becomes visible again.
Or if a user make an edit to the data cells and clicks the Save Button then the following action occurs
#1 The selected row is overwritten in the corresponding table
#2 Both the Cancel and Save Buttons become non-visible.
So my questions are
#1 In a List Screen, is there the ability to toggle the data cells for a single row from editable to not- editable using a Button and an Automation?
#2 In a List Screen, is there the ability to toggle the buttons for a single row from visible to not-visible using Buttons and an Automation?
UPDATE: I figure out how to toggle the visiblity for a button using Automations.
So now just down to this.
Is there a way to toggle, the editible status of a data cell using an Automation (ie Click a button and the data cell goes fro not-editable to editable")?
As long as the only way to select whether a data cell is editable or not is through the check box on the UI, then I guess the answer is no.
I would suggest setting up Editable in exactly the same way you can manipulate Visible
hi @Matt-3b94, welcome to Honeycode and the forum,
This is a great question. I just got doing his for the n-th time and it is a great pattern, it avoids having to send users to a separate screen to edit. The short answer is yes, see below for details and a few more ideas.
In my case you click on the row to "Open" the row and then click on "Edit" to make the fields editable. Then you use "Cancel" or "Save" once you've made the changes. Here is what it looks like by default:
and here is what it looks lie when you click "Edit" button:
In order to make editable you usually put two fields, a non editable and an editable one right below it. Then you hide the Editable one when you are in edit mode. Like so:
The display rules in my case look like this:
- for the plain (non editable) content box: =AND($[CurRow]=THISROW(),$[EditOn]<>"Y")
- for the editable content box: =AND($[CurRow]=THISROW(),$[EditOn]="Y")
(note that I put the display rule on the Content Box not on the Data Cell itself)
You do have to keep a variable somewhere on your screen called $[CurRow], this is either set to =THISROW(), or to =FALSE. And you also need $[EditOn] to keep track of when you are in edit mode or not. I use =FALSE and ="Y" as the two states, but you can use Y/N or TRUE/FALSE if you want to be more consistent. (I like to use "Y" and only check for = or <> to "Y" and don't really care about the other states; also using text becomes useful when you have a menu or Tabs you want to implement. - But this is just my peculiarity.)
The display rules on the colored row headings are a bit more complex but not too bad:
- for the colored (non editable) content box: =AND(ChecklistItems[Status][Status]="Green",NOT(AND($[CurRow]=THISROW(),$[EditOn]="Y")))
- for the colored editable content box: =AND(ChecklistItems[Status][Status]="Green",$[CurRow]=THISROW(),$[EditOn]="Y")
The logic took me a while to get working right but the above works.
If you want to make the row headings themselves toggle-able, without having to put two buttons. Then add this kind of an action on the Content Box in the header row (only the non editable one):
For the edit/done and delete buttons:
I have rules like this:
- delete =AND($[CurRow]=THISROW(),$[EditOn]="Y")
- edit =AND($[CurRow]=THISROW(),$[EditOn]<>"Y")
- done =AND($[CurRow]=THISROW(),$[EditOn]="Y")
Hope this helps, let us know if you have any further questions. I'm so glad to see you use the most effective and compact UI - love it.
Thanks Daniel. excellent. appreciate the breakdown. it's starting to make sense to me. As for the Variables
#1 Can you please provide screen shots of how set up the Variables
#2 You can put those variables anywhere on the screen, except for in a segment box? And I'm guessing you would set the visibility to FALSE so the user doesn't see them.
hi @Matt-3b94, good questions, will add the info here:
Variables: CurRow and EditOn are just Display=FALSE, non editable, Variables (not shared)
Position of variables:
They are both placed in the heading (standalone) block above the list block (you cannot add Variable data fields in the list block anyway, at the moment).
Hope this helps.