1.altRowTemplate

类型:Function | String

说明:提供表格行的交替模板,默认grid表格为每一个数据元素提供一个tr

注意:模板中最外层的html元素必须是<tr>,这个<tr>必须有一个uid属性,并设置为#= uid #,grid使用uid属性判定绑定行的元素。

Example:

通过Function方式提供模板

 <div id="grid"></div>
<script id="alt-template" type="text/x-kendo-template">
<tr data-uid="#= uid #">
<td colspan="2">
<strong>#: name #</strong>
<strong>#: age #</strong>
</td>
</tr>
</script>
<script>
$("#grid").kendoGrid({
dataSource: [
{ name: "Jane Doe", age: 30 },
{ name: "John Doe", age: 33 }
],
altRowTemplate: kendo.template($("#alt-template").html())
});
</script>

通过String方式提供模板

 <div id="grid"></div>
<script>
$("#grid").kendoGrid({
dataSource: [ { name: "Jane Doe", age: 30 }, { name: "John Doe", age: 33 } ],
altRowTemplate: '<tr data-uid="#= uid #"><td colspan="2"><strong>#: name #</strong><strong>#: age #</strong></td></tr>'
});
</script>

2. autoBind       Boolean(default:true)

说明:如果值设为false,控件在初始化期间将不绑定数据源,默认情况数据源是绑定在指定属性中的。

 $("#grid").kendoGrid({
autoBind: false,
dataSource: dataSource
});
dataSource.read();
</script>

3. columnResizeHandleWidth Number(default:3);

说明:定义column重新处理的尺寸宽度。(不常用)

4. columns      Array

Grid表格列属性,一个对象数组或字符数组,一个JS对象作为列配置被解读,一个字符数组作为绑定列的域被解读,grid将为每一个数组元素创建一列

Example:

指定列为一个字符数组:

 <div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: ["name", "age"], // two columns bound to the "name" and "age" fields
dataSource: [ { name: "Jane", age: 31 }, { name: "John", age: 33 }]
});
</script>

指定列为一个对象数组:

 <div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [{
field: "name",// create a column bound to the "name" field
title: "Name" // set its title to "Name"
}, {
field: "age",// create a column bound to the "age" field
title: "Age" // set its title to "Age"
}],
dataSource: [ { name: "Jane", age: 30 }, { name: "John", age: 33 }]
});
</script>

5.columns.aggregate

说明:给某列或分组列做合计,支持”average”,”count”,”max”,”min”,”sum”

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "firstName", groupable: false },
{ field: "lastName" }, /* group by this column to see the footer template */
{ field: "age",
groupable: false,
aggregates: [ "count", "min", "max" ],
groupFooterTemplate: "age total: #: count #, min: #: min #, max: #: max #"
}
],
groupable: true,
dataSource: {
data: [
{ firstName: "Jane", lastName: "Doe", age: 30 },
{ firstName: "John", lastName: "Doe", age: 33 }
]
}
});
</script>

6.columns.attributes

说明:为<td>添加html属性

<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [ {
field: "name",
title: "Name",
attributes: {
"class": "table-cell",
style: "text-align: right; font-size: 14px"
}
} ],
dataSource: [ { name: "Jane Doe" }, { name: "John Doe" }]
});
</script>
生成后的代码为:<td class="table-cell" style="text-align: right; font-size: 14px">...</td>.

7.未完,待续......

中文版kendoUI API — Grid(一)的更多相关文章

  1. kendoui treeview grid spreadsheet

    treeview 傻子方式获取id <!DOCTYPE html> <html> <head> <title>API</title> < ...

  2. 使用kendoui对grid指定行变色

    关键点在于绑定数据源后进行判断,可直接获取当前绑定对象的属性 dataBound: function () { dataView = this.dataSource.view(); ; i < ...

  3. jQuery EasyUI API - Grid - DataGrid [原创汉化官方API]

    最近在学习jQuery EasyUI,发现中文的文档好少,部分文档不错但它是鸟语的,为了大家也为了自己学习吧,汉化做一下笔记. 有没有说清楚的,或者翻译不正确的地方还请大家谅解指出.. 由于工作时间原 ...

  4. JDK 1.5、1.6 & 中文版API,J2EE5API大全(借鉴)

    个人分类: Java文档           Sun 公司提供的Java API Docs是学习和使用Java语言中最经常使用的参考资料之一.但是长期以来此文档只有英文版,对于中国地区的Java开发者 ...

  5. Kendo Web UI Grid里时间格式转换

    我和大家分享一下我的kendo的学习心得.如果不好的地方多多包含或者给我留言请看图 kendo里时间格式如图Oder Date列里的格式.但是我们想把时间转换成中国人习惯的格式.如Shipped Da ...

  6. eclipse 中使用中文JAVA api文档

    http://hi.baidu.com/danghj/item/7625a1be20946e43ba0e1202在eclipse中使用中文JAVA api文档Sun 官方的中文版 Java API 文 ...

  7. Stream API的代码示例.md

    一.代码实例: package com.TestMain; import com.alibaba.fastjson.JSON; import java.util.*; import java.util ...

  8. Asp.Net MVC 分页、检索、排序整体实现

    很多时候需要这样的功能,对表格进行分页.排序和检索.这个有很多实现的方式,有现成的表格控件.用前端的mvvm,用户控件.但很多时候看着很漂亮的东西你想进一步控制的时候却不那么如意.这里自己实现一次,功 ...

  9. [React]全自动数据表格组件——BodeGrid

    表格是在后台管理系统中用的最频繁的组件之一,相关的功能有数据的新增和编辑.查询.排序.分页.自定义显示以及一些操作按钮.我们逐一深入进行探讨以及介绍我的设计思路:   新增和编辑 想想我们最开始写新增 ...

随机推荐

  1. 往github上传demo

    一直在github上寻找demo,但怎么传demo上githun呢? http://www.2cto.com/kf/201504/390397.html 首先在github上 new一个reposit ...

  2. 【转】 java中HashMap详解

    原文网址:http://blog.csdn.net/caihaijiang/article/details/6280251 java中HashMap详解 HashMap 和 HashSet 是 Jav ...

  3. hdu 4608 I-number 大整数

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4608 #include <cstdio> #include <cmath> # ...

  4. 使用drawRect有什么影响

    用来画图,这个方法会在intiWithRect时候调用.这个方法的影响在于有touch event的时候之后,会重新绘制,很多这样的按钮的话就会比较影响效率.以下都会被调用1.如果在UIView初始化 ...

  5. 实现一个servlet的helloworld小程序(不适用Eclipse)

    实现一个servlet的helloworld小程序(不适用Eclipse) 1. 在tomcat中的webapps下建一个应用程序FirstServlet(C:\tomcat\webapps\Firs ...

  6. DM8168 坎坷硬件之路(DDR3)

    新做了8168板,调试DDR3的时候EMIF0遇到了个别数据位出错的问题 DDR3 128MB*8=1GB 我为了測试DDR3的所有空间,把地址存到DDR3中,就是*pdata++=(Uint32)p ...

  7. [转] 使用memc-nginx和srcache-nginx模块构建高效透明的缓存机制

    为了提高性能,几乎所有互联网应用都有缓存机制,其中Memcache是使用非常广泛的一个分布式缓存系统.众所周知,LAMP是非常经典的Web架构方式,但是随着Nginx的 成熟,越来越多的系统开始转型为 ...

  8. UWP app HelloWorld 的创建

    步骤 1:在 Visual Studio 中创建新项目 启动 Visual Studio 2015 RC.将出现 Visual Studio 2015 RC 起始页. (从现在开始,我们将 Visua ...

  9. ASP.NET-FineUI开发实践-11

    我用实例项目写了个子父页面传值,算是比较灵活的写法,可以把js提取出来写成包,然后调用,我先一步一步写,为有困难的朋友打个样. 先画个页面: 上面是个查询用的表单,底下是表格,内存分页,用到了VBox ...

  10. 使用WMI来连接远端计算机

    1. wmi连接前提 利用wmi来连接远端计算机首先要具有远端计算机管理员的用户名和密码.如果计算机在域中的话,要有域管理员用户名和密码,或者是把域帐户加入本机管理员组中也可以. 2. 相关类的用法- ...