bootstrap-table表格做条件筛选,筛选出来的结果在table里用红色字体标识关键字

bootstrap-table表格做条件筛选,筛选出来的结果在table里用红色字体标识关键字_第1张图片//查询结果--关键字标识为红色

            $("#ValueItemTable").on('post-body.bs.table', function () {

                var txtReportName = $("#ReportTempletelName").val();

                var reg = new RegExp(txtReportName, 'ig');

                var tableId = document.getElementById("ValueItemTable");


                if (txtReportName != null) {


                    for (var i = 1; i < tableId.rows.length; i++) {

                        var bb = tableId.rows[i].cells[0].innerHTML;

                        var displayColor = '' + txtReportName + '';

                        var cc = bb.replace(reg, displayColor);

                        tableId.rows[i].cells[0].innerHTML = cc;

                    }


                }

            })

你可能感兴趣的:(jquery条件筛选)