Allow table widget to have a minimum and maximum of items#740
Open
bennothommo wants to merge 13 commits intodevelopfrom
Open
Allow table widget to have a minimum and maximum of items#740bennothommo wants to merge 13 commits intodevelopfrom
bennothommo wants to merge 13 commits intodevelopfrom
Conversation
As part of this commit, I've changed the datasources to use promises, to provide a unified response between client and server-side datasources.
LukeTowers
reviewed
Oct 26, 2022
LukeTowers
reviewed
Oct 26, 2022
Member
|
@bennothommo what's the status of this? |
Member
Author
|
I'm gonna say I think it is complete... Definitely haven't tested it quite some time though. |
Member
|
@bennothommo do we have a docs PR for it? |
Member
Author
|
I will test it first, and then I'll put up a docs PR, in case anything needs to change. |
Member
|
@bennothommo what's the status on this? |
Member
Author
|
Same as before. Still needs docs and testing. Haven't had a need for it yet - I think I did this for my old job. |
Member
Contributor
|
@LukeTowers Bored to the bones 😹 . Sorry I'm currently out on this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the config variables
minItemsandmaxItemsfor the Table widget anddatatablefield type. The impetus of this is to allow a table to have no items by setting theminItemsto0- I have found in my travels that if you have any sort of validation on the table widget, then you must have at least one record, but in my case, I wanted the datatable field to be optional.I then thought it might be useful to have the opposite, and allow an upper limit for the number of records.
Some rules on the above:
minItemsmust be0or above. By default, it is1to match the current functionality. IfminItemsis2, then 2 records must be in the datatable at all times (the datatable will have 2 empty records added on load).maxItemsmust be either1or above, ornullto indicate no limit.minItemsmust be less than or equal tomaxItems, to allow a datatable to have a fixed number of records.To allow this change to happen, I've decided to change the datasource objects (client and server-side data handling) to use promises - this way, we have a common way of reading the responses, and it will gracefully handle the server-side taking a little longer to make changes to the data.