Hi Olga,
We have checked your problem on getting the selected value of DropDownTree component in form submit. For your reference, we can get the selected value of DropDownTree component in click event of submit button. Refer the below code snippet.
|
<input type="submit" value="Submit" v-on:click="onClick"/>
onClick: function (event) {
var ele = document.getElementById('ddlelement');
// checks for incomplete value and alerts the format submit
if (ele.value !== "") {
alert(ele.value);
}
} |
Page will reload when submitting the form. In this case, TreeView component will re-render, so the selected value will not be maintained in the UI. To resolve this issue, you can set the enablePersistance property as true. It restores the selected value when page reload.
Refer the below code snippet.
|
<ejs-dropdowntree id="ddlelement" :enablePersistence ='true' name="listItems" class="form-control" :fields='fields'></ejs-dropdowntree> |
If you perform any controller action on form submit then you can get the selected DropDownTree value in it, after enabling enablePersistence property.
Refer the below sample link:
If we misunderstood your requirement. can you please share the following details. It will help us to provide you the prompt solution needed.
· Code snippet of the component definition.
· Code snippet of controller action to get the DropDownTree value.(share us, if you have done any functionality in your application)
· Video footage of reported problem.
· Are you using only EJ2 DropDownTree component or using any other EJ2 components along with it?
Please let us know, if you need any further assistance.
Regards,
Sowmiya.P