KoolReport's Forum

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

PivotSql does not set default expanded for row in laravel #2973

Open Conceptualize opened this topic on on Feb 6, 2023 - 1 comments

Conceptualize commented on Feb 6, 2023

Hi

I am using PivotSQl with PivotMatrix in laravel. PivotSQL does not set rows to expand as default. Users need to click on each row to expand.

How to set the default expanded tree using PivotSql?

Sebastian Morales commented on Feb 8, 2023

In PivotMatrix you can click an icon to expand all items for any fields. Perhaps you can write a js function to evoke that icon's click once PivotMatrix is ready like this:

<script>
    function expandAllUsers() {
        //look for Users' Expanding All icon and call click
        ...
    }
</script>
<?php
PivotMatrix::create(array(
    ...
    "onReady" => "function() {
        expandAllUsers();
    }"
));
?>

Be noticed that PivotSQL is not the most efficient for expanding all nodes because each node expanding requires one sql query executing.

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
bug

None