Got this error when I added the property scrollY

Got this error when I added the property scrollY

areddyareddy Posts: 5Questions: 1Answers: 0
edited December 2018 in Free community support

Got this error when I added the property scrollY.


Could someone help me with this. Used 1.10.18 version

Uncaught TypeError: s.match is not a function
at _fnStringToCss (jquery.dataTables.js:5839)
at i.fn.init._fnScrollDraw (jquery.dataTables.js:5441)
at jquery.dataTables.js:6636
at Function.map (BundledJQuery.min.js:2)
at _fnCallbackFire (jquery.dataTables.js:6635)
at _fnDraw (jquery.dataTables.js:3507)
at _fnReDraw (jquery.dataTables.js:3550)
at _fnInitialise (jquery.dataTables.js:4732)
at loadedInit (jquery.dataTables.js:1294)
at HTMLTableElement.<anonymous> (jquery.dataTables.js:1306)

Answers

  • kthorngrenkthorngren Posts: 21,345Questions: 26Answers: 4,954

    scrollY is working on this page:
    https://datatables.net/examples/basic_init/scroll_y.html

    The problem must be something specific to your environment. To help with debugging please post a link to your page or a test case replicating the issue.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • areddyareddy Posts: 5Questions: 1Answers: 0

    $('#tblEvaluators').DataTable({
    scrollY: "500px",
    scrollCollapse: true,
    paging: false,
    destroy: true,
    language: {
    search: "INPUT",
    searchPlaceholder: "Search Evaluator"
    },
    data: evaluators.data,
    //ajax: {
    // "url": 'Evaluators.aspx/GetAllEvaluators',
    // "dataSrc": ''
    //},
    columns: [
    { "data": "FullName" },
    {
    "data": "GeneralRotationQueueFlag",
    "render": function (data, type, row) {
    return (data === true) ? '<i class="fas fa-check"></i>' : '';}
    },
    {
    "data": "ActiveFlag",
    "render": function (data, type, row) {
    return (data === true) ? '<i class="fas fa-check"></i>' : '';}
    }
    ],
    createdRow: function (row) {
    $(row).addClass('cursor-pointer evaluator-row');
    },
    columnDefs: [
    { className: "text-center", "targets": [1, 2] }
    ],
    dom:
    "<'row d-flex justify-content-around'<'col-4'B><'col-8'f>>" +
    "<'row'<'col-12'tr>>" +
    "<'row'<'col-12 text-center'i>>",
    buttons: [
    {
    text: '<i class="fas fa-user-plus"></i>  Add an evaluator',
    attr: {
    class: 'btn btn-outline-secondary btn-sm mt-1',
    id: 'addEvaluator',
    "data-toggle": 'modal',
    "data-target": '#addEditEvaluatorModal'
    }
    }
    ]
    });

  • areddyareddy Posts: 5Questions: 1Answers: 0

    Here is my Code

  • areddyareddy Posts: 5Questions: 1Answers: 0

    when I tried to use datatables without ScrollY, Everything worked without any errors. When I removed paging and added ScrollY, then I got errors in other pages too

  • areddyareddy Posts: 5Questions: 1Answers: 0

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    Can you use http://live.datatables.net or JSFiddle to give us a test case so we can debug it please?

    Allan

This discussion has been closed.