Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
Thanks for the quick response! I am looking at the example https://www.koolreport.com/examples/reports/datagrid/server_processing/. What are the packages that need to be installed for this to work like the example code?
Here is my code. I know the query works. This is the exact query.
use koolreport\core\Utility as Util;
use koolreport\datagrid\DataTables;
DataTables::create([
'name' => 'Patient Utilization',
"dataSource"=>function() {
return $this->src('results')
->query("
select concat(p.lname,' ' , p.fname) as name,
(select count(*) from openemr_postcalendar_events as e where e.pc_pid = p.pid and e.pc_facility = 3 and e.pc_eventDate between $oneYearAgo and CURDATE()) as patient_appt
from patient_data as p
where p.financial_review_exp > '2019-07-01' and not testing=1
");
},
'scope' => $this->params,
"options" => [
"searching" => true,
"paging" => true,
"pageLength" => 10,
],
"showFooter"=>true,
"serverSide"=>true,
]);
According to my IDE, the Utility is not used. I appreciate the help.
Sherwin, pls open dev tool (F12) then refresh your page (F5) to check xhr request. Dev tool wouldn't register xhr request sent before its opening. Once you find xhr response please look for either tag <dt-ajax (in case there's no back end error) or any PHP error if there is. Cheers,
Well well well, there definitely must have been some javascript error when the table initialized that prevented it from sending xhr request for data. If you opened the dev tool's console tab I'm sure there would be some red error message.
Looking at the code again, I guess this is where the error came from:
'name' => 'Patient Utilization',
...
Because we use a widget name as its client-side object id (so users could refer to it for its client-side functions if they need them) the name must be a correct javascript variable name which 'Patient Utilization' isn't. Please just remove the space and test your DataTables again. Cheers,
I changed the 'name' to 'PatientUtilization'. It did not change anything. The system is not executing the ajax call to the database to get records. There are no error messages in the console and no errors logged in the PHP error log. Thanks for trying to assist.
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo