-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Allow table widget to have a minimum and maximum of items #740
base: develop
Are you sure you want to change the base?
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.
@bennothommo what's the status of this? |
I'm gonna say I think it is complete... Definitely haven't tested it quite some time though. |
@bennothommo do we have a docs PR for it? |
I will test it first, and then I'll put up a docs PR, in case anything needs to change. |
@bennothommo what's the status on this? |
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. |
@LukeTowers Bored to the bones 😹 . Sorry I'm currently out on this. |
This PR adds the config variables
minItems
andmaxItems
for the Table widget anddatatable
field type. The impetus of this is to allow a table to have no items by setting theminItems
to0
- 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:
minItems
must be0
or above. By default, it is1
to match the current functionality. IfminItems
is2
, then 2 records must be in the datatable at all times (the datatable will have 2 empty records added on load).maxItems
must be either1
or above, ornull
to indicate no limit.minItems
must 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.