Kendo UI:Grid自定义command实现对行数据的操作

来源:互联网 发布:03年搞笑网络歌曲 编辑:程序博客网 时间:2024/06/07 18:42

http://blog.csdn.net/sun_jy2011/article/details/41546467

问题

Grid中如何自定义操作列?

解决方案

通过click选项设置,如

[html] view plain copy
  1. {  
  2.         name: "details",  
  3.         click: function(e) {  
  4.           var tr = $(e.target).closest("tr"); // get the current table row (tr)  
  5.           var data = this.dataItem(tr);  
  6.           console.log("Details for: " + data.name);  
  7.         }  
  8. }   

command可以自定义或通过kendo封装好的"edit"(编辑)or"destroy"(删除)(前提是grid是可编辑的)两种的来创建。如

[html] view plain copy
  1. {  
  2.       name : "edit",  
  3.       text :   
  4.       {  
  5.           edit : "编辑",  
  6.           update : "保存",  
  7.           cancel : "取消"  
  8.        }  
  9. },  
  10. {  
  11.        name : "destroy",  
  12.        text : "删除"  
  13. }  
原创粉丝点击