KoolReport's Forum

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

Uncaught Exception: dataSource is required for DataTables #2418

Closed George opened this topic on on Nov 4, 2021 - 1 comments

George commented on Nov 4, 2021

I want to create a datatable with array data instead of using a dataSource like here: https://www.koolreport.com/docs/datagrid/datatables/#use-data-property.

However when I try to render it I get an error Uncaught Exception: dataSource is required for DataTables telling me I need to use a dataSource.

I'm not sure what I'm doing wrong here.

Sebastian Morales commented on Nov 5, 2021

Hi George, it's a bug with data property of DataTables. We will fix it in the next release of Datagrid package. Meanwhile you can still use the dataSource property with an array like this:

            DataTables::create(array(
                "dataSource"=>array(
                    array("name"=>"Peter","age"=>35),
                    array("name"=>"Karl","age"=>31),
                )
            )); 

Let us know if you have any question. 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
help needed

DataGrid