• easyui datagrid checkbox multiple columns have been done do


    lengku1987
     
    2013-01-06 22:27:47
     

    Sponsored Links
     
    easyui datagrid checkbox multiple columns have been done do? it is not possible to do ah.

    Sponsored Links

     
    xuan0751
    2013-01-06 23:07:28
     
    multiple columns with checkbox?
    jerryflex
    2013-01-06 23:28:34
     
    ah how 2 have checkbox box how to do?
    fine209
    2013-01-06 23:56:18
     
    {field: 'id', title:'', 10, checkbox: true },
    {field: 'name1', title: 'name1', 10, checkbox: true},
    {field: 'name2', title: 'name2' , 10, checkbox: true} ...
    yangyile1989
    2013-01-07 00:25:05
     
    this way you can click it? seems not right click on a choice on the other are.
    zfh05219
    2013-01-07 00:40:55
     
    it is you want to achieve cell selected? Then you try to use the field's property editor, type = checkbox
    zhangruihu9
    2013-01-07 00:58:15
     
    I have encountered this problem, it was solved?
    wizardzc
    2013-01-07 01:17:45
     

    +1
    ruler2009
    2013-01-07 01:42:37
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Complex DataGrid - jQuery EasyUI Demo</title>
    <link rel="stylesheet" type="text/css" href="../themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../themes/icon.css">
    <link rel="stylesheet" type="text/css" href="demo.css">
    <script type="text/javascript" src="../jquery-1.6.min.js"></script>
    <script type="text/javascript" src="../jquery.easyui.min.js"></script>
    <script>
    $(function(){
    $('#test').datagrid({
    title:'My DataGrid',
    iconCls:'icon-save',
    700,
    height:350,
    nowrap: false,
    striped: true,
    collapsible:true,
    url:'datagrid_data.json',
    sortName: 'code',
    sortOrder: 'desc',
    remoteSort: false,
    idField:'code',
    frozenColumns:[[
                    {field:'ck',checkbox:true},
                    {title:'code',field:'code',80,sortable:true}
    ]],
    columns:[[
            {title:'Base Information',colspan:3},
    {field:'opt',title:'Operation',100,align:'center', rowspan:2,
    formatter:function(value,rec){
    return '<span style="color:red">Edit Delete</span>';
    }
    }
    ],[
    {field:'name',title:'Name',120},
    {field:'addr',title:'Address',220,rowspan:2,sortable:true,
    sorter:function(a,b){
    return (a>b?1:-1);
    }
    },
    {field:'col4',title:'Col41',150,rowspan:2}
    ]],
    pagination:true,
    rownumbers:true,
    toolbar:[{
    id:'btnadd',
    text:'Add',
    iconCls:'icon-add',
    handler:function(){
    $('#btnsave').linkbutton('enable');
    alert('add')
    }
    },{
    id:'btncut',
    text:'Cut',
    iconCls:'icon-cut',
    handler:function(){
    $('#btnsave').linkbutton('enable');
    alert('cut')
    }
    },'-',{
    id:'btnsave',
    text:'Save',
    disabled:true,
    iconCls:'icon-save',
    handler:function(){
    $('#btnsave').linkbutton('disable');
    alert('save')
    }
    }]
    });
    var p = $('#test').datagrid('getPager');
    $(p).pagination({
    onBeforeRefresh:function(){
    alert('before refresh');
    }
    });
    });
    function resize(){
    $('#test').datagrid('resize', {
    700,
    height:400
    });
    }
    function getSelected(){
    var selected = $('#test').datagrid('getSelected');
    if (selected){
    alert(selected.code+":"+selected.name+":"+selected.addr+":"+selected.col4);
    }
    }
    function getSelections(){
    var ids = [];
    var rows = $('#test').datagrid('getSelections');
    for(var i=0;i<rows.length;i++){
    ids.push(rows[i].code);
    }
    alert(ids.join(':'));
    }
    function clearSelections(){
    $('#test').datagrid('clearSelections');
    }
    function selectRow(){
    $('#test').datagrid('selectRow',2);
    }
    function selectRecord(){
    $('#test').datagrid('selectRecord','002');
    }
    function unselectRow(){
    $('#test').datagrid('unselectRow',2);
    }
    function mergeCells(){
    $('#test').datagrid('mergeCells',{
    index:2,
    field:'addr',
    rowspan:2,
    colspan:2
    });
    }
    </script>
    </head>
    <body>
    <h2>Complex DataGrid</h2>
    <div class="demo-info">
    <div class="demo-tip icon-tip"></div>
    <div>Click the button to do actions with datagrid.</div>
    </div>

    <div style="margin:10px 0;">
    <a href="#" onclick="getSelected()">GetSelected</a>
    <a href="#" onclick="getSelections()">GetSelections</a>
    <a href="#" onclick="selectRow()">SelectRow</a>
    <a href="#" onclick="selectRecord()">SelectRecord</a>
    <a href="#" onclick="unselectRow()">UnselectRow</a>
    <a href="#" onclick="clearSelections()">ClearSelections</a>
    <a href="#" onclick="resize()">Resize</a>
    <a href="#" onclick="mergeCells()">MergeCells</a>
    </div>

    <table id="test"></table>

    </body>
    </html>


    can be achieved,
    koalas2009
    2013-01-07 02:08:38
     
    Set the selected row when, checkbox is not checked, the checkbox is selected, it is not selected row, set the following:
    checkOnSelect: false,
    ; selectOnCheck: false,

    there is a method that uses formatter generates checkbox, then select the checkbox, when selected will not be associated with the entire line.
    wzx870606
    2013-01-07 02:25:00
     
    function deleteCheckBoxEvent (eventName) {
    $ ("# messageBox1"). unbind (eventName);
    $ ("# emailBox1"). unbind (eventName);
    $ ("# payBox1"). unbind (eventName);
    $ ("# all"). unbind (eventName);
    }
    explained: lift off checkbox The click event. If the read data from the background once again refresh the table and continue to lift.
  • 相关阅读:
    深入A标签点击触发事件而不跳转的详解
    js、css、html判断浏览器的各种版本
    深入理解this对象
    背景透明文字不透明的最佳方法兼容IE(以背景黑色透明度0.5为例)
    解决ie6支持最大高度最小高度的方法
    js点击更多显示更多内容效果
    artdialog关闭弹出窗口
    (巧用)事件代理
    CSS3盒模型display:-webkit-box;的使用
    文件上传input type="file"样式美化
  • 原文地址:https://www.cnblogs.com/azhqiang/p/4432587.html
Copyright © 2020-2023  润新知