Conditional dropdown - Hide every property when not selected
Hi!
First of all - really cool plugin, we really needed a plugin like this for several cases.
When using the conditional dropdown and the user has not selected the desired value from the dropdown it shouldn't let any property show specified in the datatype, because what we have now is confusing:
In this case looks pretty straight forward but what if your configurations also include hiding other properties?
If you had an extra property that you want to show only if text boxes is selected? Even more complicated, what if you had 3 options in the dropdown and you want to show the property only if 2 of those are selected? Would you show it on load or not?
I think i have an idea for a solution that can work for everyone and not just for an specific case.
This would be allowing an empty option in the configuration, so you could choose what you want to show or hide when nothing is selected.
I'll try to get a new release with the fix soon.
EDIT:
You can add an empty option to the configuration. To do so you have to remove the 'required' attribute form the input that sets the value in the \App_Plugins\ConditionalDisplayers\prevalueeditors\cdMultivalues.html
<div>
<input type="text" ng-model="item.value" val-server="item_{{$index}}" required <<<---remove that />
</div>
You will be able to create an empty option that you can configure with those values you want to hide/show if none of the other options is selected.
Conditional dropdown - Hide every property when not selected
Hi!
First of all - really cool plugin, we really needed a plugin like this for several cases.
When using the conditional dropdown and the user has not selected the desired value from the dropdown it shouldn't let any property show specified in the datatype, because what we have now is confusing:
As you can see it shows both the properties.
In this case looks pretty straight forward but what if your configurations also include hiding other properties?
If you had an extra property that you want to show only if text boxes is selected? Even more complicated, what if you had 3 options in the dropdown and you want to show the property only if 2 of those are selected? Would you show it on load or not?
Look in the App_Plugins folder for the plugin.
In the controller:
Create 2 vars:
$scope.showTextBoxes = false
$scope.showRichTextBoxes = false
Look for the onChange function for the drop down and set either of the above variables to true when selected.
In the editor view
Use the Angular "ng-if" to hide the two editors
You might need some validation as well but without looking at the code I'm not sure.
If you want to post the plugin controller js and the editor html I might be able to help further!
I think i have an idea for a solution that can work for everyone and not just for an specific case.
This would be allowing an empty option in the configuration, so you could choose what you want to show or hide when nothing is selected.
I'll try to get a new release with the fix soon.
EDIT: You can add an empty option to the configuration. To do so you have to remove the 'required' attribute form the input that sets the value in the
\App_Plugins\ConditionalDisplayers\prevalueeditors\cdMultivalues.html
You will be able to create an empty option that you can configure with those values you want to hide/show if none of the other options is selected.
@Mario
it works fine without adding value
if try to add value it will not work
is working on a reply...