KoolReport's Forum

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

Datagrid popover not working on next page #1756

Closed ankit raj opened this topic on on Dec 10, 2020 - 2 comments

ankit raj commented on Dec 10, 2020

Hi , I have enabled popover on click of a row element , but due to pagination(client side) when i click on next page , the data table redraws and so popover function needs to be called again.

    $('[data-toggle="popover"]').popover();

i checked the datatables website and turns out , you need to call this function whenever you redraw datatable:

 drawCallback: function() {
    $('[data-toggle="popover"]').popover();
  }  

How do i enable it using koolreports because the same syntax throws me an error?

Sebastian Morales commented on Dec 10, 2020

Just convert the client setting in js to php like this:

    \koolreport\datagrid\DataTable::create(array(
        ...
        "options" => array(
            "drawCallback" => "function() {
                $('[data-toggle=\"popover\"]').popover();
            }"
        )
    ));

Let us know how it works. Cheers,

ankit raj commented on Dec 11, 2020

Thanks , worked fine: just a slight tweak from your answer:

   "drawCallback"=> "function() {
                $('[data-toggle=\"popover\"]').popover();
            }",

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