The question of how to add a checkbox to a table view has come up before:
The answer (attaching an action to a blank virtual column) was provided but as I don’t think the implementation is completely self evident, I thought I’d provide a little example and explain the steps one needs to follow to implement it.
First, here’s an image to illustrate the goal:
The empty checkbox and the checked checkbox are the same action. When the action is invoked it changes a column called “Check” from either “FALSE” to “TRUE” or “TRUE” to “FALSE”.
The action uses the following expression:
It has been attached the an empty text column (a virtual column). In this case, I called the column “Blank” but the name could be anything because the name of the column will not be shown in the table.
Next, attach the action to the blank column as follows:
To get the action to appear to be an empty checkbox when the column “Check” is “FALSE” or blank, choose the following icon for the action:
Now, go to UX --> Format rules and make the following format rule:
This way, when the action does it’s work and changes the “Check” column value to “TRUE”, the icon will change to a box with a check in it. It will revert back to an empty box (and the “Check” column value will go to “FALSE”) if you tap on the action again.
Now, how do we place the action within the table? Here’s the column view for the table view (UX --> Views):
This places the check after the “Name” column. If the “Blank” column is placed after the “Number” column, it will look like this:
Well, that’s about it. The only thing I couldn’t figure out how to do is to give the blank action column a header. The action will “attach,” in a sense, to the column that precedes it but I can’t figure out any way to avoid having blank space in the header position above the action.
P.S. This is one of several tips I have put together about how to work with table view. Here’s a link to the rest: