Telerik Kendo UI [2] culture (Chinese) and telerikkendo

Source: Internet
Author: User
Tags web hosting

Telerik Kendo UI [2] culture (Chinese) and telerikkendo

On CSDN, there is a blog about the web hosting software, which contains the common usage of the kendo ui. I will not repeat it here.

Due to the framework design requirements, the background uses spring and the foreground uses kendo ui to build the page. In order to speed up fast sending and the underlying compatibility, it is incumbent upon us to continue to use hibernate as a bridge for database communication. There are more examples of spring over the Internet, mainly using spring annotation MVC configuration and json data Cer.

After preliminary use, it is found that the design of the kendo ui is extremely powerful. Its MVVM features are combined with the MVC features of spring, such as list presentation when used in conjunction with the hibernate development system, almost no query code is required.

In addition, the culture has been hosted on GitHub and can be used directly after configuration. For date formatting, I tried multiple times and used simple settings in the Chinese file to solve the global date setting problem.

The following describes in detail how to achieve the above results:

I. Culture

My habit is to get the control no matter where it is. The first is to check whether the demo is dazzling or the amount of code. The second is to check the international support and whether the Chinese-language dictionary files and other features can be supported, if you cannot directly set Chinese as a global feature, but must change its usage, you can leave it alone. The kendo ui has passed both of my customs. The following describes the specific practices.

Go to the following URL and download the kendo. messages. zh-CN.js file, which is the Chinese internationalization file of the kendo ui.

Https://github.com/telerik/kendo-ui-core/tree/master/src/messages

The content is as follows:

/* FlatColorPicker messages */if (kendo. ui. flatColorPicker) {kendo. ui. flatColorPicker. prototype. options. messages = $. extend (true, kendo. ui. flatColorPicker. prototype. options. messages, {"apply": "OK", "cancel": "cancel"});}/* ColorPicker messages */if (kendo. ui. colorPicker) {kendo. ui. colorPicker. prototype. options. messages = $. extend (true, kendo. ui. colorPicker. prototype. options. messages, {"apply": "OK", "ca Ncel ":" cancel "});}/* ColumnMenu messages */if (kendo. ui. columnMenu) {kendo. ui. columnMenu. prototype. options. messages = $. extend (true, kendo. ui. columnMenu. prototype. options. messages, {"sortAscending": "ASCENDING", "sortDescending": "descending", "filter": "filter", "columns": "column ", "done": "complete", "settings": "column settings", "lock": "lock", "unlock": "unlock "});} /* Editor messages */if (kendo. ui. editor) {kendo. ui. editor. prototype. options. Messages = $. extend (true, kendo. ui. editor. prototype. options. messages, {"bold": "bold", "italic": "italic", "underline": "underline", "strikethrough": "strikethrough", "superscript ": "superscript", "subscript": "subscript", "justifyCenter": "center", "justifyLeft": "Left alignment", "justifyRight": "right alignment ", "justifyFull": "alignment at both ends", "insertUnorderedList": "insert unordered list", "insertOrderedList": "insert ordered list", "indent": "add indent ", "outdent": "reduce indentation", "createLink": "insert link "," Unlink ":" Remove link "," insertImage ":" insert image "," insertFile ":" insert file "," insertHtml ":" insert HTML "," viewHtml ": "view HTML", "fontName": "select font", "fontNameInherit": "(inherited font)", "fontSize": "select font size", "fontSizeInherit ": "(inherited font size)", "formatBlock": "formatBlock", "formatting": "formatting", "foreColor": "color", "backColor ": "background color", "style": "style", "emptyFolder": "empty folder", "uploadFile": "Upload", "orderBy": "sorting condition :", "orderBySize": "size", "orderB YName ":" name "," invalidFileType ":" The selected file \ "{0} \" is invalid. The Supported file type is {1 }. "," DeleteFile ": 'Are you sure you want to delete \" {0 }\"? ', "OverwriteFile":' The current folder already has a file named \ "{0} \". Are you sure you want to overwrite it? ', "DirectoryNotFound": "This folder cannot be found", "imageWebAddress": "image address", "imageAltText": "Alternative text", "imageWidth": "width (px) "," imageHeight ":" height (px) "," fileWebAddress ":" file address "," fileTitle ":" title "," linkWebAddress ":" link address ", "linkText": "link text", "linkToolTip": "link prompt", "linkOpenInNewWindow": "Open in new window", "dialogUpdate": "Upload ", "dialogInsert": "insert", "dialogButtonSeparator": "or", "dialogCancel": "cancel", "createTable": "CREATE TABLE "," AddColumnLeft ":" add column on the left "," addColumnRight ":" add column on the right "," addrowabve ":" add row above "," addRowBelow ": "Add row below", "deleteRow": "Delete row", "deleteColumn": "delete column"}) ;}/ * FileBrowser messages */if (kendo. ui. fileBrowser) {kendo. ui. fileBrowser. prototype. options. messages = $. extend (true, kendo. ui. fileBrowser. prototype. options. messages, {"uploadFile": "Upload", "orderBy": "sorting condition", "orderByName": "name", "orderBySize": "size", "di RectoryNotFound ":" This folder is not found "," emptyFolder ":" folder is empty "," deleteFile ": 'Are you sure you want to delete \" {0 }\"? ', "InvalidFileType": "The selected file \" {0} \ "is invalid. The Supported file type is {1 }. "," OverwriteFile ":" The current folder already has a file named \ "{0} \". Are you sure you want to overwrite it? "," DropFilesHere ":" drag the file to be uploaded here "," search ":" search "});}/* FilterMenu messages */if (kendo. ui. filterMenu) {kendo. ui. filterMenu. prototype. options. messages = $. extend (true, kendo. ui. filterMenu. prototype. options. messages, {"info": "display rows that meet the following conditions", "isTrue": "true", "isFalse": "false", "filter ": "filter", "clear": "clear", "and": "and", "or": "or", "selectValue": "-select -", "operator": "operator", "value": "value", "cancel": "cancel "});}/ * Filter menu operator messages */if (kendo. ui. filterMenu) {kendo. ui. filterMenu. prototype. options. operators = $. extend (true, kendo. ui. filterMenu. prototype. options. operators, {"string": {"eq": "equal to", "neq": "not equal to", "startswith": "starting with", "contains ": "include", "doesnotcontain": "does not contain", "endswith": "ends with"}, "number": {"eq": "equal to", "neq ": "not equal to", "gte": "greater than or equal to", "gt": "greater than", "lte": "less than or equal to", "lt": "less "}, "date ":{ "Eq": "equal to", "neq": "not equal to", "gte": "greater than or equal to", "gt": "greater than", "lte ": "less than or equal to", "lt": "less than"}, "enum": {"eq": "equal to", "neq": "not equal "}});} /* Gantt messages */if (kendo. ui. gantt) {kendo. ui. gantt. prototype. options. messages = $. extend (true, kendo. ui. gantt. prototype. options. messages, {"views": {"day": "day", "week": "week", "month": "month"}, "actions ": {"append": "add task", "addChild": "add subtask", "insertBefore": "add to front", "inse RtAfter ":" add to back "});}/* Grid messages */if (kendo. ui. grid) {kendo. ui. grid. prototype. options. messages = $. extend (true, kendo. ui. grid. prototype. options. messages, {"commands": {"cancel": "cancel", "canceledit": "cancel", "create": "add", "destroy": "delete ", "edit": "edit", "save": "save", "select": "select", "update": "update"}, "editable ": {"cancelDelete": "cancel", "confirmation": "Are you sure you want to delete it? "," ConfirmDelete ":" delete "});}/* Groupable messages */if (kendo. ui. groupable) {kendo. ui. groupable. prototype. options. messages = $. extend (true, kendo. ui. groupable. prototype. options. messages, {"empty": "The drag column title is displayed here by column combination"});}/* NumericTextBox messages */if (kendo. ui. numericTextBox) {kendo. ui. numericTextBox. prototype. options = $. extend (true, kendo. ui. numericTextBox. prototype. options, {"upArrowText": "add "," DownArrowText ":" "});}/* Pager messages */if (kendo. ui. pager) {kendo. ui. pager. prototype. options. messages = $. extend (true, kendo. ui. pager. prototype. options. messages, {"display": "display entries {0}-{1} total {2}", "empty": "No record to display. "," Page ":" page "," of ":" {0} "," itemsPerPage ":" Every page "," first ":" Homepage ", "last": "last page", "next": "next page", "previous": "previous Page", "refresh": "refresh", "morePages ": "More... "});}/* specify tgrid messages */if (kendo. ui. extends tgrid) {kendo. ui. required tgrid. prototype. options. messages = $. extend (true, kendo. ui. required tgrid. prototype. options. messages, {"measureFields": "Drag and Drop data fields here", "columnFields": "Drag and Drop column fields here", "rowFields": "Drag and Drop row fields here "});} /* RecurrenceEditor messages */if (kendo. ui. recurrenceEditor) {kendo. ui. recurrenceEditor. prototype. options. messages = $. extend (true, kendo. ui. recurrenceEditor. prototype. options. messages, {"frequencies": {"never": "never", "hourly": "Every hour", "daily": "Every Day", "weekly ": "Weekly", "monthly": "monthly", "yearly": "annual"}, "hourly": {"repeatEvery": "recurrence:", "interval ": "Hour"}, "daily": {"repeatEvery": "Repetition Period:", "interval": "day"}, "weekly": {"interval ": "Week", "repeatEvery": "repetition cycle:", "repeatOn": "repetition at:"}, "monthly": {"repeatEvery": "repetition cycle :", "repeatOn": "repetition:", "interval": "month", "day": "date"}, "yearly": {"repeatEvery": "repetition cycle: "," repeatOn ":" repetition: "," interval ":" year "," of ":" month: "}," end ": {" label ": "Deadline:", "cancelabel": "Deadline", "never": "never", "after": "repeat", "occurrence": "after ", "on": "stops at"}, "offsetPositions": {"first": "first", "second": "second", "third": "third ", "fourth": "fourth", "last": "last"}, "weekdays": {"day": "day", "weekday": "workday ", "weekend": "weekend"});}/* Scheduler messages */if (kendo. ui. schedo) {kendo. ui. scheduler. prototype. options. messages = $. extend (true, kendo. ui. scheduler. prototype. options. messages, {"today": "today", "save": "save", "cancel": "cancel", "destroy": "delete", "deleteWindowTitle ": "Delete event", "ariaSlotLabel": "select from {0: t} to {1: t}", "ariaEventLabel": "{0} on {1: d} at {2: t} "," views ": {" day ":" day "," week ":" week "," workWeek ":" workday ", "agenda": "calendar", "month": "month"}, "recurrenceMessages": {"deleteWindowTitle": "delete cycle entries", "deleteWindowOccurrence ": "Delete current event", "deleteWindowSeries": "delete sequence", "editWindowTitle": "Modify cycle entry", "edit1_woccurrence": "modify current event", "editWindowSeries ": "Modify sequence"}, "editor": {"title": "title", "start": "start", "end": "end", "allDayEvent ": "all-day events", "description": "description", "repeat": "DUPLICATE", "timezone": "", "startTimezone": "Start Time Zone ", "endTimezone": "End Time Zone", "separateTimezones": "Use an independent start time and End Time Zone", "timezoneEditorTitle": "Time Zone", "timezoneEditorButton": "Time Zone ", "timezoneTitle": "Select time zone", "noTimezone": "NONE", "editorTitle": "Event" }});}/* Slider messages */if (kendo. ui. slider) {kendo. ui. slider. prototype. options = $. extend (true, kendo. ui. slider. prototype. options, {"increaseButtonTitle": "added", "decreaseButtonTitle": "reduced"}) ;}/ * TreeView messages */if (kendo. ui. treeView) {kendo. ui. treeView. prototype. options. messages = $. extend (true, kendo. ui. treeView. prototype. options. messages, {"loading": "loading... "," requestFailed ":" loading failed "," retry ":" retry "});}/* Upload messages */if (kendo. ui. upload) {kendo. ui. upload. prototype. options. localization = $. extend (true, kendo. ui. upload. prototype. options. localization, {"select": "select... "," cancel ":" cancel "," retry ":" retry "," remove ":" remove "," uploadSelectedFiles ":" upload files "," dropFilesHere ": "drag the file to be uploaded here", "statusUploading": "uploading", "statusUploaded": "uploaded", "statusWarning": "warning", "statusFailed ": "failed", "headerStatusUploading": "upload... "," headerStatusUploaded ":" finished "});}/* Validator messages */if (kendo. ui. validator) {kendo. ui. validator. prototype. options. messages = $. extend (true, kendo. ui. validator. prototype. options. messages, {"required": "{0} is required", "pattern": "{0} illegal", "min ": "{0} should be greater than or equal to {1}", "max": "{0} should be less than or equal to {1}", "step ": "{0} illegal", "email": "{0} is not a legal email address", "url": "{0} is not a legal URL", "date ": "{0} is not a valid Date"});} if (Date) {Date. prototype. toISOString = function () {return kendo. toString (this, "yyyy-MM-dd HH: mm: ss ");};}


Note that the last if (Date) is added by myself. The main purpose is to solve the serialization problem of the time date object obtained by the date control. When the date object communicates to the background, because the background is spring MVC Framework, the parameters are all transmitted through kendo. stringify (XX) method, or JSON. to serialize the stringify (XX) method, the toISOString method of the Date object is called by default to format the Date object. By Rewriting the toISOString of the Date object in the cultural file, it is compatible with Spring background MVC and transmits the Date object. The format is consistent with the Date format of the spring background MVC json view er. In this way, the Date type object can be ensured, and the frontend and backend transmission is normal. The original file downloaded from gitHub does not contain this content.

How can I use an international file? Very simple. Just introduce it directly in the page header!

<%@ page language="java" pageEncoding="UTF-8"%><%@ page contentType="text/html;charset=UTF-8"%><%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><!DOCTYPE html >

Note that the last three lines of the

The Gridview effect after the Chinese version is shown in the preceding two figures. It works very well and is global and carefree! Please use it!

Let's take a look at the combined use of the calendar control and the Gridview, and configure the Filter effect:

 

Chinese culture is so simple!





The kendo ui can have two x axes when drawing a line chart.

Assume that the concentration in A1: A5 and B1 is B5. Click "insert"> "chart"> "line chart", "Next", and "Data zone "; select (or enter ):!
= $ B $1 in Sheet1: in category (X) axis label, select (or enter) $ B $5

Click "series ":

= Worksheet Sheet1 $ A $1 :! $ A $5
"Done.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.