Search not working

Search not working

aclaytonaclayton Posts: 2Questions: 0Answers: 0
edited March 2021 in Free community support
var table = $('#job-codes-table').DataTable({

                columns: [
                    { data: 'code' },
                    { data: 'description' }
                ],
                data: jobCodesArr,
                select: {
                    style: 'multi'
                },
                drawCallback: function (settings) {
                    console.log('DataTables has redrawn the table');
                },
                initComplete: function () {
                    dtComplete($(this));
                }

            });

            table.on('select deselect', function (e, dt, type, items) {
                updateSelection(table, 'jobCodesToAdd');
            });

            $('#code-filter').on('keyup', function () {
                table.search( $(this).val() ).draw();
            });

very simple case, search not working ... no errors ... can see drawCallback firing after keyup on filter.

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Replies

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • aclaytonaclayton Posts: 2Questions: 0Answers: 0

    thanks Colin.

    http://live.datatables.net/wunibedu/1/edit?html,js,output

    not sure what I'm doing wrong for the custom search field not to be working.

  • kthorngrenkthorngren Posts: 20,275Questions: 26Answers: 4,765

    It seems to work. If I type wiper into your search input it works. Please provide the steps to show the issue you are asking about.

    Kevin

This discussion has been closed.