通过Row Attributes设置Bootstrap Table行属性(鼠标行title提示)

设置表格行tr的属性,如设置<tr data-index="序号" title="序号+产品名称">
通过rowAttributes属性设置,代码如下:

 //bootstrap table初始化数据
        $('#table').bootstrapTable({
            columns: columns,
            data: getData(),
            classes: "table table-bordered table-striped table-sm table-dark",
            height: 400,
            rowAttributes: function (row, index) {
                return {
                    'data-toggle': 'popover',
                    'data-placement': 'bottom',
                    'data-trigger': 'hover',
                    'data-index': index,
                    'title': [
                        'Index: ' + index,
                        'ID: ' + row.ProductName
                    ].join(', ')
                }
            }
        });