shuheb / ag-grid-angular-laravel-mysql

Example showcasing AG Grid server-side row model implemented with Laravel backend and MySQL database
https://blog.ag-grid.com/using-ag-grid-server-side-row-model-angular-laravel-mysql/
8 stars 5 forks source link

Data are not Loading... #1

Closed nickwe3 closed 3 years ago

nickwe3 commented 3 years ago

Hello,

I have successfully installed and configured everything on Cent0S and archlinux, mysql table have created and poluated by php artisan, start laravel and the client, I can access the web interface at http://localhost:4200/ but infortunately on both system instead of the data loading into the grid, I'm stuck with a "* Loading"

php artisan serve
Starting Laravel development server: http://127.0.0.1:8000
[Thu Jul 15 15:41:19 2021] PHP 8.0.8 Development Server (http://127.0.0.1:8000) started
[Thu Jul 15 15:43:31 2021] 127.0.0.1:50552 Accepted
[Thu Jul 15 15:43:31 2021] 127.0.0.1:50552 Closing
[Thu Jul 15 15:43:31 2021] 127.0.0.1:50560 Accepted
[Thu Jul 15 15:43:31 2021] 127.0.0.1:50560 Closing
npm run start

> client@0.0.0 start
> ng serve

 Browser application bundle generation complete.

Initial Chunk Files | Names         |      Size
vendor.js           | vendor        |   6.69 MB
styles.css          | styles        | 138.33 kB
polyfills.js        | polyfills     | 127.63 kB
main.js             | main          |  18.58 kB
runtime.js          | runtime       |   6.15 kB

                    | Initial Total |   6.98 MB

Build at: 2021-07-15T13:55:05.546Z - Hash: aa3c7556f2a5af1bb008 - Time: 9368ms

Warning: /home/manjaro/finiko/ag-grid-angular-laravel-mysql/client/src/app/app.component.ts depends on 'ag-grid-enterprise'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

 Compiled successfully.
MariaDB [(none)]> show databases ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sample_data        |
| test               |
+--------------------+
5 rows in set (0.000 sec)

MariaDB [(none)]> use sample_data
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [sample_data]> show tables ;
+-----------------------+
| Tables_in_sample_data |
+-----------------------+
| athletes              |
| failed_jobs           |
| migrations            |
| password_resets       |
| users                 |
+-----------------------+
5 rows in set (0.000 sec)

So I don't understand how could I debug or make some checks, my .env is well populated with DB connection, table athletes has all the data from the json files.

Thanks and Regards,

Nicolas.

nickwe3 commented 3 years ago

OK found it, it was looking for sample_data.ATHLETES instead of sample_data.athletes, so the file server/app/Http/Controllers/AthleteController.php need to be changed accordingly.

shuheb commented 3 years ago

Hi @nickwe3

Happy to hear that you've fixed your issue, it sounds like this is an issue with case sensitivity.

In Line 32 of server/app/Http/Controllers/AthleteController.php: $fromSql = " FROM ATHLETES ";

I'm assuming that it is case sensitive, in which case I'll update the line to $fromSql = " FROM athletes ";.

Thanks for letting me know - hope you enjoy using ag-grid! :)

nickwe3 commented 3 years ago

Hi @nickwe3

Happy to hear that you've fixed your issue, it sounds like this is an issue with case sensitivity.

In Line 32 of server/app/Http/Controllers/AthleteController.php: $fromSql = " FROM ATHLETES ";

I'm assuming that it is case sensitive, in which case I'll update the line to $fromSql = " FROM athletes ";.

Thanks for letting me know - hope you enjoy using ag-grid! :)

In fact it's case sensitive, at least on Linux, and now everything is working like a charm after having just done the same modification as you :)

shuheb commented 3 years ago

Thanks for letting me know, I didn't know that. Great to hear that everything is working fine now :) Will close the issue as it's solved.