BootStrap(二) -- 在表格行添加按钮并取得选中行数据

在 column 中加入

{
                                                field : 'operate',
                                                title : '您可以选择',
                                                align : 'center',
                                                events : operateEvents,
                                                formatter : operateFormatter
                                            } 

**其中 events 是点击时候发生事件** 
window.operateEvents = {
        'click .addToMyCourse' : function(e, value, row, index) {
            alert(row.id);
            alert(e);
            alert(value);
            alert(index);
        },
        'click .myCourse' : function(e, value, row, index) {
            alert("B");
        }
    }

e : 选中行的对象 object
row : 通过 row.id 等可以获得表格里的任意一列信息
index: 表格行的下标 从零开始
value: 值

formatter 中的事件

function operateFormatter(value, row, index) {
        return [
                '',
                '' ]
                .join('');
    }

Js css下载地址:http://download.csdn.net/detail/jacxuan/9815125

你可能感兴趣的:(bootstrap响应式框架)