vedmack / yadcf

Yet Another DataTables Column Filter (yadcf)
http://yadcf-showcase.appspot.com/
MIT License
731 stars 285 forks source link

Datatables in NodeJS trying to use yadcf but getting error 'yadcf is not defined' #601

Closed XDavidT closed 4 years ago

XDavidT commented 4 years ago

I just installed the npm in my nodejs express project, then try to add it to the javascript that loading my page:

$(document).ready(function(){
    var logsTable = $('#dataTableLogs').DataTable( {
        order:[[1,""]],
        processing: true,
        serverSide: true,
        ajax: {
            url: '/api/logs/loadata',
            type: 'POST'
        },
        columns: [
            {data: 'logid'},
            {data: 'insert_time'},
            {data: 'type'},
            {data: 'src'},
            {data: 'cat'},
            {data: 'hostname'},
            {data: 'ip_add'},
            {data: 'mac_add'},
            {data: 'username'},
            {data: 'os'}

        ]
    } )

    yadcf.init(logsTable,[
        {column_number : 0},
    ])
})

But when I'm loading the page, I'm getting error saying "yadcf is not defined". By the npm page, I didn't say any other instruction to start use..

vedmack commented 4 years ago

you should add yadcf to your npm, see this https://www.npmjs.com/package/yadcf