Check/uncheck All and generation of forms
Opened this issue · 4 comments
A couple of matters of clarification:
- I am generating pages primarily for the adding of new records and I see the two check boxes to Check/uncheck all columns in a table. What is the purpose of the second of the two? When I click on the first box it toggles the selection of all columns. I don't grasp what the second one does.
- My second query is with regards limiting what columns are displayed as fields in the generated forms, which I thought was affected by the Show column function.
The tables I am working with have fields that are restricted to back-end (admin) users after forms are submitted by public-facing users. It seems I would have to edit the generated forms to prevent the showing of fields such as table IDs, account status, time stamps or text areas for admin notes.
In summary, what is the purpose of the second toggle and can one decide what columns are generated as form fields? The completed app from the image above would correctly show an HTML table without the account_id column but the account-create.php would display the account_id field.
Is the ID field set depending on whether the column is auto incremented, because the behaviour isn't consistent with all column IDs? The setting here:
Results in (although other columns not selected also are in the form):
- What is the purpose of the second of the two?
- You have spotted a glitch in UI, the second column of checkboxes should be only visible when at least one table has a foreign key.
The checkboxes under "This table" are used to display the selected column in the list view of each table.
If you had foreign keys in your schema, you would see "Related tables" in column #2.
It would be used to display the selected column when it is referenced as foreign key in another table. Columns keys id, name, reference are checked by default.
Here's an example:
This will show a countries.name
column on users-index.php (without countries.id
column)
I have some ideas on how to improve this, will implement in the coming weeks.
- the Show column function
It changes the layout of the table onto the generated "Read" pages (xxxx-index.php). You should already have:
The completed app from the image above would correctly show an HTML table without the account_id column
I've checked the code and I haven't seen any impact on the Create/Edit pages so far.
That's a cool idea to implement.
In order to avoid breaking compatibility with existing apps, I suggest that we offer the choice.
Sometimes you want a compact table, sometimes a full-fledged form.
- My suggestion is to add a new column of checkboxes for form visibility:
Does it make sense?
Is the wording clear enough?
We've struggled to find a presentation for this concept (see this comment and below) so any suggestion is welcome.
Is the ID field set depending on whether the column is auto incremented
- The ID will be auto incremented if your table schema says so (ex:
CREATE TABLE
brands(
idint(11) NOT NULL AUTO_INCREMENT
). - If you've set NOT NULL without auto-increment it will produce an error.
The ID is passed via GET so that won't make any difference if we remove the field from the form.
We also need to hide the unchecked columns on xxxx-read.php and xxxx-update.php, right?
- What is the purpose of the second of the two?
You have spotted a glitch in UI, the second column of checkboxes should be only visible when at least one table has a foreign key.
The checkboxes under "This table" are used to display the selected column in the list view of each table.
If you had foreign keys in your schema, you would see "Related tables" in column #2. It would be used to display the selected column when it is referenced as foreign key in another table. Columns keys id, name, reference are checked by default.
Here's an example:
This will show a
countries.name
column on users-index.php (withoutcountries.id
column)I have some ideas on how to improve this, will implement in the coming weeks.
I suspected as much that it was related to the presence of foreign keys. The original db as MyIsaam and the two columns of and I thought after reading the user guide that that should not be the case if the tables were InnoDB; so I changed them to InnoDB and the behaviour didn't change.
I think we're on the same page with your 2. re showing/hiding.
Best.