kendo ui grid 汉化

加入js引用

<link href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.common.min.css" rel="stylesheet" />
<link href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.default.min.css" rel="stylesheet" />
<script src="http://cdn.kendostatic.com/2014.2.716/js/jquery.min.js"></script>
<script src="http://cdn.kendostatic.com/2014.2.716/js/kendo.all.min.js"></script>
<script src="kendo.culture.zh-CN.min.js"></script>
<script src="kendo.messages.zh-CN.js"></script>

html标签:

<input id="datepicker" value="10/10/2011" style="width:150px;" />
<div id="example">
<div id="grid"></div>
</div>

js代码例如以下:

 <script>
var data = { data: [{ id: 1, name: "test1" }, { id: 2, name: "test2" }], total: 25 }
$(function () {
kendo.culture("zh-CN");
$("#grid").kendoGrid({
dataSource: {
data: data,
schema: {
data: "data",
total: "total",
model: {
id: "id",
fields: {
id: "id",
name: "name"
}
}
},
pageSize: 20
},
editable: {
confirmation: true,
mode: "popup",
window: {
title: "新增"
}
},
scrollable: false,
sortable: true,
filterable: true,
pageable: {
input: true,
numeric: false
},
columns: [
{ field: "id", title: "id", format: "{0:c}", width: "130px" },
{ field: "name", title: "名称", width: "130px" },
{ command: ["edit", "destroy"], title: " ", width: "200px" }
]
});
$("#datepicker").kendoDatePicker();
});
</script>

效果图例如以下:

kendo ui grid 汉化

kendo ui grid 汉化

总结:

1.kendo.culture("zh-CN"); 是设置当前kendo 使用的语言

2.kendo grid中的title 汉化的地方是

editable: {

                    confirmation: true,

                    mode: "popup",

                    window: {

                        title: "新增"

                    }

                }

3.通过上面的步骤一个汉化好的grid就完毕了。分页,编辑,button都汉化好了。

转载请标注出自:http://blog.csdn.net/zhangyuanwei88  谢谢

上一篇:linux下的静态库和动态库


下一篇:linux下so动态库一些不为人知的秘密(上)