KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Ajax call to update all the columns in Datatable #2246

Open Chris Sideris opened this topic on on Aug 4, 2021 - 1 comments

Chris Sideris commented on Aug 4, 2021

Hi Koolreport,

I am creating a Datatable using koolreport\datagrid\DataTables; and then I am using a separate AJAX call to update some columns with images and it is working fine. However, I have one issue that I am only able to update the records that are currently visible on the page and all the other records that are in the other pagination pages remain unchanged. How can I update the rest of the records as well?

Thanks

Sebastian Morales commented on Aug 5, 2021

There's a "drawCallback" event of DataTables where you could call your column update function like this:

    <script>
        function updateColumn() {
            ...
        }
    </script>
    <?php
    DataTables::create(array(
        ...
        "options" => array(
            "drawCallback" => "function() { updateColumn(); }",
    ));

Hope this helps. Rgds,

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

DataGrid