zoukankan      html  css  js  c++  java
  • easyui datagrid editor checkbox 单击事件

            Easyui datagrid treegrid中能够为行追加checkbox元素。比如:

        $('#tt').treegrid({
        url:'get_data.php',
        idField:'id',
        treeField:'name',
        columns:[[
        {title:'Task Name',field:'name',180},
        {field:'persons',title:'Persons',60,align:'right'},
        {field:'begin',title:'Begin Date',80},
        {field:'end',title:'End Date',80,editor:{type:'checkbox',options:{on:'1',off:'0'}}}
        ]]
        });

    当中最后一列的checkbox:true即为复选框,建议不要使用

    {field:'end',title:'End Date',80,formatter:function(val,row,index){
    return '<input type="checkbox"/>' ;
    }}
    这样的方法导致复选框随行的选中而选中,不灵活。

    那么怎样给这样的复选框追加单击事件或者传值呢?方法例如以下:

    onLoadSuccess:function(row,data){
        var eds = $('#dr_col_auth').datagrid('getEditors',id);
        $(eds[0].target).bind('click',function(){
          //这里能够指定当前行的数据
        }
    } 
    

    
    

  • 相关阅读:
    docker 部署 禅道系统
    docker 部署 jenkins
    运筹方法
    软件工程基础知识
    操作系统知识
    程序设计语言基础知识
    计算机组成与配置
    oracle触发器
    性能测试监控工具的使用
    数据库设计范式
  • 原文地址:https://www.cnblogs.com/llguanli/p/7141076.html
Copyright © 2011-2022 走看看