0
Я пытаюсь реализовать jquery plugin для выделения поиска текста в мое приложение, и я использую this topic, я положил JQuery плагин для моего приложения и добавьте следующую строку:Выделите таблицу поиска текста начальной загрузки
$table.highlight($(".search.bs.table").val());
Но поиск текста по-прежнему не выделяется. Кто-нибудь может мне объяснить, где моя ошибка?
код:
function initTable() {
$table.bootstrapTable({
filterControl: true,
//data: url,
//url: 'data/events.json',
height: getHeight(),
formatNoMatches: function() {
return "Please, choose your category";
}
});
// sometimes footer render error.
setTimeout(function() {
$table.bootstrapTable('resetView');
}, 200);
$table.on('check.bs.table uncheck.bs.table ' +
'check-all.bs.table uncheck-all.bs.table', function() {
$remove.prop('disabled', !$table.bootstrapTable('getSelections').length);
// save your data, here just save the current page
selections = getIdSelections();
// push or splice the selections if you want to save all data selections
});
$table.on('all.bs.table', function (e, name, args) {
console.log(name, args);
});
$table.highlight($(".search.bs.table").val());
$table.on('search.bs.table', function (e, text){
"use strict";
console.log(e);
console.log(text);
});
$remove.click(function() {
var ids = getIdSelections();
$table.bootstrapTable('remove', {
field: 'id',
values: ids
});
$remove.prop('disabled', true);
});
$(window).resize(function() {
$table.bootstrapTable('resetView', {
//height: getHeight()
});
});
}