Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lfittl/condition-fields-js
Make form fields for AND/OR conditions that are stored as JSON in your database.
https://github.com/lfittl/condition-fields-js
Last synced: 21 days ago
JSON representation
Make form fields for AND/OR conditions that are stored as JSON in your database.
- Host: GitHub
- URL: https://github.com/lfittl/condition-fields-js
- Owner: lfittl
- Created: 2013-07-31T15:00:30.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-07-31T15:00:46.000Z (over 11 years ago)
- Last Synced: 2024-12-03T04:25:36.444Z (23 days ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.html
Awesome Lists containing this project
README
condition-fields.js
condition-fields.js
A helper library to make form fields for AND/OR conditions in queries/reports that are stored as a JSON field in your database.
Usage
For example, lets say your customer wants to create a report where the elements are either is_valid and is_index, or which are marked as always_show.
The data would be stored and output by you like this:
<input type="hidden" name="conditions" value="[{'is_valid': 'true', 'is_indexed': 'true'}, {'always_show': 'true'}]" />
condition-fields.js then turns it into:
$('#test').conditionFields();
After each data change the conditions hidden field is updated, so you can use standard form submission without worry.
License & Copyright
Licensed under MIT license.
Copyright © 2013, Lukas Fittl <[email protected]>