Form
Form copied to clipboard
Add Multiple Selection, Or Check Boxes
Please add a control like check boxes, or a dropdown menu with multiple selection.
@charbelhass thanks! We'll look into it.
I have implemented this before, I might take a look if/when I get some time guys :+1:
thank you :D
:cake:
any chance someone can do this? :)
@danr777 Hi danr777! Mind giving us a use case to start brainstorming on the best way to do this?
Hi there, Could be anything really?Could be as simple as What are your favorite categories of foods? storing the answer value as a delimited string wouldn't be wrong would it? and splitting it upon value retrieval, is there a structural issue with storing the value that would be different than most of the other answer types?
@danr777 That's a great idea! I'll look into it
Our biggest issue at the moment is that a FORMField
stores only one value
https://github.com/hyperoslo/Form/blob/master/Source/Models/FORMField.h#L27
json representation could be something like this:
{
"id":"foods",
"title":"Favourite Foods",
"type":"radio",
"options": [
{
"id" : "uid"
"value" : "ice-cream"
},
etc..
]
}
populate the radioField subclass from the options array, which dynamically creates the boxes.
you can then store a sub-array of checked boxes against the FORMField anyway as it is of type id anyway,
Any news about this one. Thanks in advance
Hello again @3lvis can we have the multiselect on master branch
This is how it should look
Can this be limited to one selection? To make it act like a radio button?
The JSON for the field could look like this,
{
"id": "skill_types",
"title": "Has the patient had or presently have any of the following conditions?",
"type": "multiselect",
"min_selected_values": 1,
"max_selected_values": 3,
"values": [
{
"id": 0,
"title": "Hearth Attack"
},
{
"id": 1,
"title": "Stroke"
},
{
"id": 2,
"title": "Ulcer"
},
{
"id": 3,
"title": "Chest pains"
},
{
"id": 4,
"title": "Hypertension"
},
{
"id": 5,
"title": "Cancer"
},
{
"id": 6,
"title": "Fainting"
},
{
"id": 7,
"title": "High Colesterol"
},
{
"id": 8,
"title": "Osteoporosis"
}
]
}
No progress coming soon; feel free to send a PR following the suggested design. :)
@3lvis I really like the design here, do you have anything else to go off of if one of us wants to start a PR?
Please! my previous attempt was not up to par :)
On Fri, Jun 12, 2015 at 1:11 PM Jeffrey Jackson [email protected] wrote:
@3lvis https://github.com/3lvis I really like the design here, do you have anything else to go off of if one of us wants to start a PR?
— Reply to this email directly or view it on GitHub https://github.com/hyperoslo/Form/issues/242#issuecomment-111560541.
@jeffreyjackson feel free to start a PR, let me know if I can help with anything :)
@3lvis I really like the design of the multiselect here, but I also think that it also makes sense to consider a solution similar to the current select method now. The difference would be that the rows are annotated with checkmarks for those that are selected. Therefore you would be able to select multi items in the tableView. The form field would then be delimited by commas. For a client project Im on now, hyperoslo/form has a lot of potential. The concern is that while the proposed multiselect looks great and would be awesome from a UX perspective, it would not be ideal in a scenario where there are potentially tens/hundreds of options to select from. What are your thoughts?
I'd like to consider the possibility of being to implement both, but obviously would like your consideration on this.
I see how the comma separated list would work and would be easier/faster to implement, but it feels like a halfway solution. And there are other caveats too, like you wouldn't be able to support field titles with commas, or you would have to make a field that is super long in order to show the selected results.
Personally I would prefer if we had the proposed UI, I understand that it's harder to implement but it just feels right.
First, let me ask you this:
Would it be difficult to dynamically resize the form field for large inputs instead of truncated with a ...
? Or does it have this functionality somehow now?
@jeffreyjackson Changing the width
of the field then invalidating the layout should work.
The width of the cell depends on the width
of the field. You can find the implementation here.
https://github.com/hyperoslo/Form/blob/eed1f04d63dbecf0e4a62993f4f7150a20847fdd/Source/FORMDataSource.m#L286
@3lvis I was thinking that the height would resize to show all content?
Is there any chance of implementing this still?
@aminiz maybe any of the contributors or you might help with this, personally, I don't think I will have the chance to add this feature. If you need support working on this, hit me up on https://gitter.im/hyperoslo/Form
refer to pr #594 already add this feature, hope this help