Skip to content
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

DropDownTree TagHelper renders input instead of select element when checkboxes are enabled #7795

Open
kendo-bot opened this issue Apr 9, 2024 · 0 comments
Assignees

Comments

@kendo-bot
Copy link
Contributor

kendo-bot commented Apr 9, 2024

Bug report

The DropDownTree TagHelper with enabled checkboxes does not submit the selected options when it is bound to a Model property.

Reproduction of the problem

  1. Define a DropDownTree TagHelper as a form editor and and enable its checkboxes.

  2. Bind the editor to a Model property (an array of integers).

  3. Submit the form and examine the submit request payload. The values of the selected items are missing.

//Model
public class TestFormModelClass
{
  public int[] MonthsSelectedIds { get; set; }
}

//View
@model TestFormModelClass

<form method="post">
  <kendo-dropdowntree for="MonthsSelectedIds" 
      check-all="true"
      datatextfield="Month"
      datavaluefield="Id">
      <hierarchical-datasource type="DataSourceTagHelperType.Custom">
                <schema>
                    <hierarchical-model id="id"></hierarchical-model>
                </schema>
                <transport>
                    <read url="/api/items" />
                </transport>
      </hierarchical-datasource>
      <checkboxes check-children="false" name="CheckedMonths" enabled="true" />
  </kendo-dropdowntree>

  <button type="submit">Save</button>
</form>

Expected/desired behavior

When the DropDownTree TagHelper with checkboxes is used as a form editor, the values of the selected items must be submitted as expected to the server.

Workaround

Use the HtmlHelper version of the DropDownTree

Environment

  • **Telerik UI for ASP.NET Core version: 2024.1.319
  • **Browser: [all]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants