How to create external localization file message for dropdownlist

5 posts, 1 answers
  1. Federico
    Federico avatar
    28 posts
    Member since:
    Sep 2017

    Posted 03 Oct Link to this post

    I'd like to create a new external file for custom message to show a message.

    This message will show when datasource is empty.

    This is a message for: data-no-data-template="NoDataFoundTemplate"

    I have created a new file:"kendo.message-noDataCustomMessage" .

    this is my file:

    /* <Widget-name> messages */

    if (kendo.ui.<Widget-name>) {
    kendo.ui.<Widget-name>.prototype.options.messages =
    $.extend(true, kendo.ui.<Widget-name>.prototype.options.messages,{
      "<message-name>": "<translation",
      noDataFound:"Nessun Elemento Trovato"
      //...
    });
    }

     

     

  2. Federico
    Federico avatar
    28 posts
    Member since:
    Sep 2017

    Posted 03 Oct in reply to Federico Link to this post

    What should I write instead of<widget-name>?

    and with <message-name>?

    how include this rules in the dropdownlist of my project?
  3. Federico
    Federico avatar
    28 posts
    Member since:
    Sep 2017

    Posted 03 Oct in reply to Federico Link to this post


    How i should write instead of <widget-name>?
    and with <message-name>?
    how include this rules in the my dorpdownlist of my project?
  4. Federico
    Federico avatar
    28 posts
    Member since:
    Sep 2017

    Posted 03 Oct in reply to Federico Link to this post


    How i should write instead of <widget-name>?
    and with <message-name>?
    how include this rules in the my dorpdownlist of my project?
  5. Answer
    Ivan Danchev
    Admin
    Ivan Danchev avatar
    1268 posts

    Posted 05 Oct Link to this post

    Hi Federico,

    Here's a dojo example, which shows how you can extend the DropDownList and customize the noDataTemplate text. If you want to use an external js file this is the logic responsible for changing the text that you need to add to the file:
    (function ($) {
      var CustomDropDownList = window.kendo.ui.DropDownList.extend({
        options: {
          noDataTemplate: "Nessun Elemento Trovato"
        }
      });
      window.kendo.ui.plugin(CustomDropDownList);
    })(jQuery);


    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.
Back to Top