zoukankan      html  css  js  c++  java
  • 自定义行操作事件——DataGrid系列

     1 …………
     2 
     3 @(Html.DevExtreme().DataGrid<Model>()
     4 …………
     5 .Columns(c =>
     6 {
     7   …………
     8   c.Add()
     9   .Type(GridCommandColumnType.Buttons)
    10   .Width(110)
    11   .Buttons(b =>
    12   {
    13     b.Add()
    14     .Hint("删除")
    15     .Text("删除")
    16     .OnClick("onDelMetting");
    17 
    18     b.Add()
    19     .Hint("取消")
    20     .Text("取消")
    21     .Visible(new JS("isStatusIconVisible"))
    22     .OnClick("onCancelMetting");
    23   });
    24 
    25    …………
    26 
    27 })
    28 …………
    29 
    30 )
    31 <script>
    32 //取消事件
    33 function onCancelMetting(e) {
    34   //console.log(e.row.data);
    35   var id= e.row.data.Id; //获取当前行的某一列数据
    36 }
    37 //删除事件
    38 function onDelMetting(e) {
    39   //console.log(e.row.data);
    40   var id= e.row.data.Id; //获取当前行的某一列数据
    41 }
    42 //控制按钮显示
    43 function isStatusIconVisible(e) {
    44   //console.log(e.row.data);
    45   return true;
    46 }
    47 </script>
  • 相关阅读:
    Seconds_Behind_Master的计算
    innnodb 线程在做什么?
    Mysql Join_buffer_size的使用原理
    C 实现位图排序
    C 内存池的实现
    C实现队列
    mysqld执行的函数栈
    Source Insight的基本用法
    MySQL高性能以及高安全测试
    【设计篇】状态与策略
  • 原文地址:https://www.cnblogs.com/xiaonanmu/p/15233777.html
Copyright © 2011-2022 走看看