HTML5 UI框架Kendo UI Web中如何实现Grid网格控件本地化
Kendo UI Web包含数百个创建HTML5 web app的必备元素,包括UI组件、数据源、验证、一个MVVM框架、主题、模板等。
为了使得产品可以符合不同市场的本地化需求和语言,Kendo UI中的网格控件提供了一种方法,来帮助用户通过使用配置选项来本地化用户的界面。
工具栏控件的本地化
toolbar: [ //name - name of the available commands, text - text to be set on the button { name: "create", text: "Custom Create" }, { name: "save", text: "Custom Save" }, { name: "cancel", text: "Custom Cancel" } ]
列命令的本地化
columns: [ { field: "FirstName", title: "First Name" }, { field: "LastName", title: "Last Name" }, { command: [ { name: "edit", text: { // sets the text of the "Edit", "Update" and "Cancel" buttons edit: "CustomEdit", update: "CustomUpdate", cancel: "CustomCancel" } }, { name: "destroy", text: "CustomDelete" } // sets the text of the "Delete" button ], title: " " } ]