How to prevent new request while large dataset loads?

How to prevent new request while large dataset loads?

kgomezkgomez Posts: 2Questions: 2Answers: 0

During loading of large dataset, if user changes a filter or does a name search, it crashes the site.

function CreateUserTabe() {
    $('#UserTable').dataTable({
        columns: [
            { 'data': 'FirstName' },
            { 'data': 'LastName' },
            { 'data': 'Active' },
            { 'defaultContent': '<button type="button" class="btn btn-primary" onclick="ManageUser(this)">Manage</button>' }
        ],
        serverSide: true,
        processing: true,
        language: {
            processing: '<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i><span class="sr-only">Loading...</span>'
        },
        ajaxSource: 'UsersDataHandler.ashx',
        rowId: 'UserId',
        select: true,
        deferRender: true
    });
}

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    Hi @kgomez ,

    The dataset should be very small in this example, as you have serverSide enabled, only the rows on the current page should be being returned. On thing to note is that ajaxSource is obsolete, you should use ajax now.

    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

This discussion has been closed.