This is a migrated thread and some comments may be shown as answers.

Is it possible to disable noDataTemplate

12 Answers 769 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
YK
Top achievements
Rank 1
YK asked on 15 Sep 2016, 07:50 PM

Recent Kendo update added noDataTemplate shows when there is no search result.

Is there way that make it not display in default?

12 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 17 Sep 2016, 11:11 AM
Hello Kim,

The noDataTemplate property can be disabled by setting its value to false:

http://dojo.telerik.com/EXEnu

http://docs.telerik.com/kendo-ui/api/javascript/ui/autocomplete#configuration-noDataTemplate

I hope this is helpful.

Regards,
Stefan
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Workspace
Top achievements
Rank 1
answered on 27 Apr 2017, 05:28 AM
Is it possible to keep noDataTemplate capital and small letter mixed? Always it's showing in capital letter.
0
Stefan
Telerik team
answered on 01 May 2017, 05:29 AM
Hello,

Currently, the letters in the noDataTemplate property will be displayed only in capital letters.

I can suggest submitting a feature request which will allow to modify this behaviour, and based on its popularity we may implement it in a future release:

http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/category/170292-dropdowns



Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Trevor
Top achievements
Rank 1
answered on 09 Jun 2017, 03:52 PM
Is it possible to do this when using MVVM?
0
Stefan
Telerik team
answered on 13 Jun 2017, 07:33 AM
Hello Trevor,

The noDataTemplate can be disabled using the MVVM approach as well using the following syntax:

data-no-data-template="false"

Please have in mind that all of the jQuery properties can be used with the MVVM approach as well the syntax patent is the following:

http://docs.telerik.com/kendo-ui/framework/mvvm/overview#set-data--options

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Steve
Top achievements
Rank 1
answered on 21 Jun 2017, 03:02 PM
Is it possible to achieve this in MVC ?
In js I can set noDataTemplate: false but in MVC I can only set .NoDataTemplate to a string. I tried an empty string but that just gives me the default NO DATA FOUND template
0
Ivan Danchev
Telerik team
answered on 22 Jun 2017, 07:28 AM
Hello Steve,

The AutoComplete's MVC wrapper does not allow false to be passed to the NoDataTemplate method, it only accepts string. The "NO DATA FOUND" message can be removed by passing a string containing space:
.NoDataTemplate(" ")

In case no data is found the dropdown can be prevented from popping up as shown below:
$(document).ready(function () {
    var autocomplete = $("#countries").data("kendoAutoComplete");
    autocomplete.setOptions({ noDataTemplate: false });
});


Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Steve
Top achievements
Rank 1
answered on 22 Jun 2017, 09:24 AM
Thanks Ivan. I'd figured that I could do it that way. This seems to be yet another example of where the MVC UI configuration options fall short of those available through JS
0
Shannon
Top achievements
Rank 2
answered on 14 Jan 2020, 09:32 PM

Is it possible to do this in an editortemplate?  I am currently doing it like this:

$(document).ready(function () {
        var contactCombobox = $("#ProductionContact_RecId").data("kendoComboBox");
        contactCombobox.setOptions({ noDataTemplate: false });
    });

 

It works, but I would rather have this setting live in the editortemplate so I don't have to set it on every view I use it on.  I attached my editor template.

 

0
Ivan Danchev
Telerik team
answered on 16 Jan 2020, 04:20 PM

Hello Shannon,

It is possible to call the setOptions method in an event handler of the ComboBox. For example, you are handling the DataBound event handler in the editor template, so you can make the following change to it:

window["ComboBoxContacts_OnDataBound" + '@DdoType'] = function (e) {
       e.sender.setOptions({ noDataTemplate: false });

        if (@confirmedHasEditRights) {
            var element = $("#" + '@comboId');
            $(element[0].previousSibling).append($("<span unselectable=\"on\" class=\"k-button k-primary k-clear-value k-i-close rec-details\" title=\"click to update existing\" role=\"button\" tabindex=\"-2\" style=\"width: 18px; height: 18px; padding: 0px; position: absolute; right: 5.5em; top: 1em\" onclick=\"updateContactClickCB()\"><span class=\"k-icon comboBoxButtonsClear k-i-pencil\"></span>"));
            $(element[0].previousSibling).append($("<span unselectable=\"on\" class=\"k-button k-primary k-clear-value k-i-close rec-details\" title=\"click to add\" role=\"button\" tabindex=\"-1\" style=\"width: 18px; height: 18px; padding: 0px; position: absolute; right: 3.8em; top: 1em\" onclick=\"addContact()\"><span class=\"k-icon comboBoxButtonsClear k-i-add\"></span>"));

        }        
    };

Regards,
Ivan Danchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Damcho
Top achievements
Rank 1
answered on 22 Jun 2020, 07:14 AM

Is there any method to do in Angular?

Thank you for your help.

0
Ivan Danchev
Telerik team
answered on 24 Jun 2020, 07:22 AM

Hi Damcho,

Kendo UI for Angular is a separate product. If you have questions on a specific UI for Angular component, you can ask it in the Kendo UI for Angular forums: https://www.telerik.com/forums/kendo-angular-ui

Regards,
Ivan Danchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
AutoComplete
Asked by
YK
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Workspace
Top achievements
Rank 1
Trevor
Top achievements
Rank 1
Steve
Top achievements
Rank 1
Ivan Danchev
Telerik team
Shannon
Top achievements
Rank 2
Damcho
Top achievements
Rank 1
Share this question
or