Planned
Last Updated: 03 Sep 2025 09:25 by ADMIN
Scheduled for 2025 Q4 (Nov)
Julius
Created on: 08 Jan 2025 14:55
Category: AutoComplete
Type: Bug Report
0
The NoDataTemplate() option is not serialized when set to an empty string

### Bug report

When setting the NoDataTemplate() option to an empty string, the option is not serialized.

### Reproduction of the problem

1. Define an AutoComplete with NoDataTemplate("")

2. Search for a non-existing option and notice how the popup opens and displays the default "No data found" message. When initializing the AutoComplete with jQuery and the "noDataTemplate" is set to "", the popup does not open.

A REPL sample for reproduction: https://netcorerepl.telerik.com/cfkPEClS50FUVU5z00

### Expected/desired behavior

When the NoDataTemplate("") is set and there are no results, the popup must not open. The NoDataTemplate option must work equally when using either the AutoComplete HtmlHelper or Kendo UI for jQuery AutoComplete.

### Environment

* **Telerik UI for ASP.NET MVC version: 2024.4.1112
* **Browser: [all]

1 comment
ADMIN
Alexander
Posted on: 03 Sep 2025 09:25

Hi Julius,

I believe this should be the other way around. To be frank, I personally do not find it very intuitive to deliberately treat `""` as a null value. From a more technical standpoint, null and empty strings are disparate.

As mentioned within several discussions:

  • “Null” represents the intentional absence of any object value, indicating that a variable points to no object.
  •  An empty string is a string that has nothing inside it.

To put it in a more visual perspective: 



Thus, when explicitly setting the option:

noDataTemplate: ""

An empty zero-based string literal should be rendered inside:



If the aim is to completely obscure the NoDataTemplate popup, then one should simply use the option instead:

noDataTemplate: false
Furthermore, notice that the lack of a `NoDataTemplate` configuration, along with an empty array retrieval, exhibits the same behavior within the widget instance as well:

Taking the aforementioned into consideration, I am converting this to a `jQuery` issue instead.

Kind Regards,
Alexander
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.