没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|使用教程|编辑:龚雪|2020-10-09 10:26:55.567|阅读 210 次
概述:Kendo UI for jQuery是创建现代Web应用程序的最完整UI库,全球化过程结合了组件消息的翻译(本地化)和使其适应特定的文化(国际化和从右到左的支持),本文将为大家介绍网格的全球化细节,欢迎下载最新版体验!
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
相关链接:
Kendo UI for jQuery R3 2020试用版下载
Kendo UI目前最新提供Kendo UI for jQuery、Kendo UI for Angular、Kendo UI Support for React和Kendo UI Support for Vue四个控件。Kendo UI for jQuery是创建现代Web应用程序的最完整UI库。
全球化过程结合了组件消息的翻译(本地化)和使其适应特定的文化(国际化和从右到左的支持)。
网格的全球化功能通过以下方式启用:
通过提供日期和数字的解析和格式化选项,国际化进程将特定的区域性格式应用于Web应用程序。
有关更多信息,请参阅:
网格提供用于在不同文化区域设置中呈现日期的选项。 最常见的情况是:
显示日期取决于客户时区
默认情况下,Grid从服务器收到日期对象后立即在客户端上创建日期对象,默认JavaScript日期对象基于当前时间自动添加时间偏移。之所以采用默认操作,是因为date对象表现出相同的默认操作,并且大多数用户希望看到其当前时区中的日期。
下面的示例演示如何根据当前时区使用偏移量创建其他时间。
<p></p> <div id="grid"></div> <script> var newDate = new Date("2020-01-01T18:45"); $('p').html(newDate); $('#grid').kendoGrid({ dataSource:{ data:[{date: new Date("2020-01-01T18:45")}] } }) </script>
在客户端和服务器上使用UTC
要以UTC时区显示日期而不管用户时区如何,请参考有关。
允许用户自定义时区
下面的示例演示如何允许用户手动选择所需的时区。
<div id="example"> <p>Please choose a timezone: </p> <input id="timeZone" style="width: 100%;" /> <hr /> <div id="grid"></div> <script> currentoffsetMiliseconds = (new Date()).getTimezoneOffset() * 60000; offsetMiliseconds = 0; // Modify the current offset if the server is not in UTC. // currentoffsetMiliseconds = ((new Date()).getTimezoneOffset() - 120) * 60000; $(document).ready(function() { var data = [ { text: "GMT+1", value: "1" }, { text: "GMT+2", value: "2" }, { text: "GMT-1", value: "-1" }, { text: "GMT-2", value: "-2" }, { text: "GMT", value: "0" } ]; $("#timeZone").kendoDropDownList({ dataTextField: "text", dataValueField: "value", dataSource: data, index: 0, change:onChange }); var dataSource = new kendo.data.DataSource({ requestEnd:onRequestEnd, batch: true, transport: { read: { url: "//demos.telerik.com/kendo-ui/service/tasks", dataType: "jsonp" }, update: { url: "//demos.telerik.com/kendo-ui/service/tasks/update", dataType: "jsonp" }, create: { url: "//demos.telerik.com/kendo-ui/service/tasks/create", dataType: "jsonp" }, destroy: { url: "//demos.telerik.com/kendo-ui/service/tasks/destroy", dataType: "jsonp" }, parameterMap: function(options, operation) { var tizeZoneValue = $("#timeZone").data('kendoDropDownList').value(); offsetMiliseconds = (3600000 * tizeZoneValue); // Remove the current timezone offset and add the offset choosen by the user in the DropDownList. if ((operation == "update" || operation == "create") && options.models){ for(let i = 0; i < options.models.length; i++) { var startDate = new Date(options.models[i].Start); startDate = new Date(startDate.getTime() - (currentoffsetMiliseconds + offsetMiliseconds)); options.models[i].Start = startDate; } } if (operation !== "read" && options.models) { return {models: kendo.stringify(options.models)}; } } }, schema: { model: { id: "taskId", fields: { taskId: { from: "TaskID", type: "number" }, title: { from: "Title", defaultValue: "No title", validation: { required: true } }, start: { type: "date", from: "Start" }, end: { type: "date", from: "End" }, startTimezone: { from: "StartTimezone" }, endTimezone: { from: "EndTimezone" }, description: { from: "Description" }, recurrenceId: { from: "RecurrenceID" }, recurrenceRule: { from: "RecurrenceRule" }, recurrenceException: { from: "RecurrenceException" }, ownerId: { from: "OwnerID", defaultValue: 1 }, isAllDay: { type: "boolean", from: "IsAllDay" } } } } }); $("#grid").kendoGrid({ dataSource: dataSource, height: 430, toolbar: ["create", "save", "cancel"], editable:true, pageable: true, columns:[ {field:"taskId", title: "Tast ID"}, {field:"title", title: "Title"}, {field:"start", title: "Start Date", format: "{0:MM/dd/yyyy h:mm tt}",editor: customDateTimePickerEditor}, ] }); }); function onRequestEnd(e) { if (e.response && e.response.length) { var data = e.response; if (this.group().length && e.type == "read") { handleGroups(data); } else { loopRecords(data); } } } function onChange(e){ $("#grid").data('kendoGrid').dataSource.read() } function handleGroups(groups) { for (var i = 0; i < groups.length; i++) { var gr = groups[i]; offsetDateFields(gr); if (gr.HasSubgroups) { handleGroups(gr.Items) } else { loopRecords(gr.Items); } } } function loopRecords(records) { for (var i = 0; i < records.length; i++) { var record = records[i]; offsetDateFields(record); } } function offsetDateFields(obj) { var tizeZoneValue = $("#timeZone").data('kendoDropDownList').value(); for (var name in obj) { var prop = obj[name]; // The following replace method is needed because the dates are received from the server in the following format "/Date(1500469281437)/". if (typeof (prop) === "string" && prop.indexOf("/Date(") == 0) { obj[name] = prop.replace(/\d+/, function (n) { // Calculate the offset based on the user selection in the DropDownList offsetMiliseconds = (3600000 * tizeZoneValue); // Remove the current timezone offset and add the offset choose by the user in the DropDownList. return parseInt(n) + offsetMiliseconds + currentoffsetMiliseconds; }); } } } function customDateTimePickerEditor(container, options) { $('<input required name="' + options.field + '"/>') .appendTo(container) .kendoDateTimePicker({}); } </script> </div>
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@fc6vip.cn
文章转载自:慧都网本文将带大家学习如何在Kendo UI for Angular 网格组件中使用Angular的httpResource API,欢迎下载最新版组件体验!
本文主要介绍DevExpress WPF Grid控件如何将数据绑定虚拟数据源,欢迎下载最新版组件体验!
本教程主要为大家介绍DevExpress WinForms数据网格控件中的过滤器行功能,欢迎下载最新版组件体验!
本文主要介绍了Tool Call Confirmation API层和DevExpress Blazor AI Chat组件的相关可自定义接口,欢迎下载最新版体验!
全新升级的Kendo UI,是创建数据丰富的Web应用程序的最完整UI库。
Kendo UI for jQuery完整的jQuery UI组件库,可快速构建出色的高性能响应式Web应用程序。
Kendo UI for Angular完整的Angular UI组件库,助力构建高性能的现代Angular应用。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@fc6vip.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢