简体   繁体   English

如何让Datatable按标签搜索

[英]How to make Datatable to search by tags

I want to make a search that will search by tags within the datatable values just like this guy did, but my way of creating datatable is quite different.我想进行一个搜索,就像这个人所做的那样,通过数据表值中的标签进行搜索,但我创建数据表的方式却大不相同。 I used jquery Ajax to fill the table.我使用 jquery Ajax 来填充表格。 I want the tags to be focused on customerName ie.我希望标签集中在customerName即。 (data[2]). (数据[2])。

$(function(){
    showDataTable();
});

function showDataTable() {
    reportsDataTable = $('#reportsDataTable').DataTable({
        emptyTable      : 'No record of Company found',
        lengthChange    : true,
        processing      : true,
        responsive      :true,
        scrollX:        true,
        ajax : {
            'url'   : '/reports/findAll',
            'type'  : 'POST'
        },
        columns : [
            {'data' : 'issueDate'},
            {'data' : 'values'},
            {'data' : 'customerName'}
        ],
        searching   : true,
        buttons : ['excel', 'csv', 'pdf', 'copy'],
       scrollCollapse: true
    });
}

I tried to implement the same way as that guy did but the search field gets disappear.我试图以与那个人相同的方式实现,但搜索字段消失了。 Is there any way to implement it.有什么方法可以实现它。

Please help!!..请帮忙!!..

我在研究 javascript、jquery 等前端技术时遵循的一个经验法则是检查然后仔细检查脚本标签/cdn 链接我相信这个答案可能会帮助您解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM