KoolReport's Forum

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

Turn off Sorting #2680

Open James Schlies opened this topic on on May 17, 2022 - 3 comments

James Schlies commented on May 17, 2022

Is is possible to turn off sorting on a Datagrid report???

I've tried:

 "options"    => [
                "order"  => [ ],
                "orders"  => [ ],
               // "sorting"  => false,
                "sorting"  => [],
            ],
Sebastian Morales commented on May 18, 2022

Pls try this:

DataTables::create(array(
    "options" => array(
        "order" => [], // turn off default initial sorting
        "ordering" => false, // turn off sorting ability
    )
));

You can also turn off initial sorting "order" => [] while still allowing for "ordering" => true.

James Schlies commented on May 18, 2022

Thanks - one last related thing. In the places there I use sort - it's sorting numerics as string

        'total_wrvus'                                   => [
            "label" => "Total wRVU",
            "type"  => "decimal",
            "decimals" => 2,
            "sum",
        ],
Sebastian Morales commented on May 21, 2022

If you use decimal point and thousand separator in your column pls try to set its type to "num-fmt" like this:

        'total_wrvus'                                   => [
            "label" => "Total wRVU",
            "type"  => "num-fmt", // sort types: "num", "num-fmt", "date", "string"
            "decimals" => 2,
            "sum",
        ],

Let us know how it works for you. Tks,

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
None yet

None