Javascript Pentaho 6.1-在字段中搜索时如何显示可能结果的下拉列表?
我有两个字段用于查找值显示在表的第一列和第四列中。我想显示一个可能值的下拉列表从我写的文本开始 如何在表组件的后期执行中更改下面的javascript函数来实现这一点Javascript Pentaho 6.1-在字段中搜索时如何显示可能结果的下拉列表?,javascript,jquery,pentaho,pentaho-cde,pentaho-ctools,Javascript,Jquery,Pentaho,Pentaho Cde,Pentaho Ctools,我有两个字段用于查找值显示在表的第一列和第四列中。我想显示一个可能值的下拉列表从我写的文本开始 如何在表组件的后期执行中更改下面的javascript函数来实现这一点 function f() { $(document).ready(function () { // Setup - add a text input to each footer cell var arrayColumns = ['ID', 'Type']; $('
function f() {
$(document).ready(function () {
// Setup - add a text input to each footer cell
var arrayColumns = ['ID', 'Type'];
$('#example thead th').each(function () {
var testo = $('#example thead th').eq($(this).index()).html();
var title = $('#example thead th').eq($(this).index()).text();
if (arrayColumns.indexOf(title) > -1) {
$(this).html(testo + '<br><input type="text" placeholder="Search ' + title + '">');
}
});
// DataTable
var table = $('#example').DataTable();
// Apply the search.
table.columns().eq(0).each(function (colIdx) {
$('input', table.column(colIdx).header()).on('keyup change clear', function () {
table
.column(colIdx)
.search(this.value)
.draw();
});
// If you click in the field, it doesn't sort the results in the column in ascending/descending order.
$('input', table.column(colIdx).header()).on('click', function (e) {
e.stopPropagation();
});
});
});
}
函数f(){
$(文档).ready(函数(){
//设置-向每个页脚单元格添加文本输入
var arrayColumns=['ID','Type'];
$('#示例thead th')。每个(函数(){
var testo=$('#示例thead th').eq($(this.index()).html();
var title=$('#示例thead th').eq($(this.index()).text();
if(数组列索引(标题)>-1){
$(this.html(testo+'
');
}
});
//数据表
变量表=$(“#示例”).DataTable();
//应用搜索。
table.columns().eq(0).each(函数(colIdx){
$('input',table.column(colIdx).header()).on('keyup change clear',function(){
桌子
.列(colIdx)
.search(此.value)
.draw();
});
//如果在字段中单击,则不会按升序/降序对列中的结果进行排序。
$('input',table.column(colIdx).header())。on('click',函数(e){
e、 停止传播();
});
});
});
}