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

DropDownList editor in a Form throws a js exception when ServerFiltering is enabled #7699

Closed
IvanDanchev opened this issue Jan 29, 2024 · 0 comments
Assignees
Labels
Bug C: DropDownList C: Form FP: Completed Sync status with associated Feedback Item Next Release Item that will be included in the next official release S: Wrappers (ASP.NET Core) S: Wrappers (ASP.NET MVC) SEV: Medium
Milestone

Comments

@IvanDanchev
Copy link
Contributor

Bug report

DropDownList editor in a Form component with ServerFiltering enabled causes a js exception.

Reproduction of the problem

  1. Enable ServerFiltering in the DropDownList editor:
@(Html.Kendo().Form<MVCFormValidation.Models.UserViewModel>()
	.Name("formExample")
	.HtmlAttributes(new { action = "/Home/Index", method = "POST" })
	.Validatable(v =>
	{
		v.ValidateOnBlur(true);
		v.ValidationSummary(vs => vs.Enable(false));
	})
	.Items(items =>
	{
		items.AddGroup()
			.Label("Registration Form")
			.Items(i =>
			{

				i.Add()
					.Field(f => f.FirstName)
					.Label(l => l.Text("First Name:"));

				i.Add()
					.Field(f => f.LastName)
					.Label(l => l.Text("Last Name:"));

				i.Add()
					.Field(f => f.NumberOfShares)
					.Label(l => l.Text("Number Of Shares:"));

				i.Add().Field(m => m.Country.Id)
					.Editor(e => e.DropDownList().DataSource(source =>
					{
						source.Read(read =>
						{
							read.Action("GetCountries", "Home");		
						})
						.ServerFiltering(true);
					}).Filter(FilterType.Contains).DataTextField("Name").DataValueField("Id"))
					.Label("Country");

				i.Add()
					.Field(f => f.Email)
					.Label(l => l.Text("Email:"));
				i.Add()
					.Field(f => f.DateOfBirth)
					.Label(l => l.Text("Date of Birth:").Optional(true));
				i.Add()
					.Field(f => f.Agree)
					.Label(l => l.Text("Agree to Terms:"));
			});
	})
)

Current behavior

On page load a js exception is thrown:
Uncaught Error: Syntax error, unrecognized expression: #

Expected/desired behavior

No exceptions.

Environment

  • Kendo UI version: 2023.3.1114
  • jQuery version: 3.4.1, 3.7.1
  • Browser: [all]
@aleksandarevangelatov aleksandarevangelatov self-assigned this Jan 31, 2024
@Dimitar-Goshev Dimitar-Goshev added this to the 2024 Q2 milestone Feb 22, 2024
@Dimitar-Goshev Dimitar-Goshev added the Next Release Item that will be included in the next official release label Feb 22, 2024
@github-actions github-actions bot added FP: Completed Sync status with associated Feedback Item and removed FP: Unplanned Sync status with associated Feedback Item labels Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug C: DropDownList C: Form FP: Completed Sync status with associated Feedback Item Next Release Item that will be included in the next official release S: Wrappers (ASP.NET Core) S: Wrappers (ASP.NET MVC) SEV: Medium
Projects
None yet
Development

No branches or pull requests

3 participants