KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

How can we fix the header of the Datatable report? #895

Open paulo opened this topic on on May 28 - 5 comments

paulo commented on May 28

I'm trying to fix the header, so when scrolling down we don't lose the the columns. How can this be done in the report? I've tried this but it doesn't fix the header. It shows on the top and the bottom of the report. I thought I woudl scroll down and the header would stay on the top

  DataTables::create(array(
        "dataSource"=>$this->dataStore("searchabletours"),
        "options"=>array(
            "searching"=>true,
            "fixedHeader"=>true
           // "paging"=>true,
        ),
        "columns"=>array(

thanks

David Winterburn commented on Jun 4

Hi Paulo,

To use DataTables' fixed header option you would need the FixedHeader extension which we haven't included as default for datagrid. Please download the extension via this link:

https://datatables.net/extensions/fixedheader/#Download

Then add or replace the downloaded files to folder packages/datagrid/DataTables. Finally see if the fixedHeader option works or not. Thanks!

paulo commented 7 days ago

is there a way to install via composer? thanks

David Winterburn commented 6 days ago

Hi Paulo,

These are mostly js and css files. You could download and replace the files to the datagrid/Datatables folder. We will consider if the fixHeader plugin should be included in the future versions of datagrid. Thanks!

paulo commented 5 days ago

thanks David. the challenge is for most part I don't have access to the server. My understanding is a lot of people here are on the same boat. We use code control like github and the deployment process takes care of this. In my case I user Forge and Digital Ocean. So, I never have to manually install anything. If/when I do, I need time from administrators which is always a challenge. If we could have that as part of the full cycle, it would be much better.

Thanks for getting back to me. I will try the way you described. Paulo

David Winterburn commented 4 days ago

Hi Paulo,

I've just checked the latest Datagrid package. It seems the DataTables widget already had the FixedHeader extension included. Please try the option again and let us know if it works for you or not:

        "options"=>array(
            ...
            "fixedHeader" => true,
            ...
        ),

Thanks!

Give tips to supporter for his good work

If you feel that supporter has done a good work, consider giving him some credit. Any amount put into the tips box below is appreciated. By doing so, you have contribtuted to the existence of KoolReport and the quality of support.

Tips box
help needed

None