KoolReport's Forum

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

DataTable disable client side sort #2514

Closed Ron opened this topic on on Dec 30, 2021 - 1 comments

Ron commented on Dec 30, 2021

I am using a DataTable widget on my report. when I run it I see on each column header two arrows to sort ASC/DSC. I want to disable it.

this is the DataTable code:

DataTables::create(array(
            "name" => "myTable",
            "language" => "he", //use 'DataTables.de.json'
            "dataSource"=>$this->dataStore("st"),
            "emptyValue" => "", // use an empty string as filler for empty values
            "options"=>array(
                "colReorder"=>false,
                "order"=>[],
                'columnDefs' => array(
                    array(
        				'visible' => false,
        				//'targets' => [$this->monthDays+6], //hide the first column
        			)
        		),
            ),
            'complexHeaders' => true,
            'headerSeparator' => ' - ',
            "groupCellsInColumns" => [0, 1], // group similar cells in columns
            'cssClass'=>array(
                'table'=>'table table-bordered w-100',
                'tr'=>'cssItem',
                'td'=>function($row,$colName)
                {
                    return in_array($colName, array('teacher_id','id_number', 'reason')) ? 'border-dark text-right' : 'border-dark text-center';
                },
                'th'=>function($colName)
                {
                    return in_array($colName, array('teacher_id','id_number','reason')) ? 'border-dark text-right' : 'border-dark text-center';
                },
            ),
        ));
Ron commented on Dec 30, 2021

Found the way.

"options"=>array(
    'ordering' => false,
),

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