Trying to use a custom data source #3147
Replies: 1 comment 12 replies
-
Further update: now the ajax callback isn't working anymore. It's hitting the callback, but it's acting like it's returning the wrong datatype again. This was working just a few days ago, and I haven't changed that much in the code; I even tried reverting my changes but I was still getting the error. The error I'm getting is Here is my endpoint code that, when I return
Netbox is my custom data model that I'm using in conjunction with my custom auth file that it's throwing the setContent() error on when I return what I assume should be correct, which is |
Beta Was this translation helpful? Give feedback.
-
I have a custom data source, which is API endpoints. I am trying to use those endpoints (1 per page) as my "database" for my DataTables. I was told by a member of the DataTables community to use a custom ajax config setting for my DataTable, but I'm unsure on how to do that with Yajra. Is there anything I can do to make my DataTable not use the default db connection defined in .env? Here is my index.blade.php:
My 'user-data' route also returns a custom Eloquent Builder object that should include everything needed, but I can't get my DT to actually use it to see if it's correct or not. Any help would be extremely appreciated! :)
Update: Okay, I got my ajax callback route set up correctly (by reading this page), but now it's not hitting it on initial load, whereas before it was (when it was throwing an error--and hitting the wrong endpoint), so no data loads, and the paginate buttons don't display. I have to manually change the number of records to get it to show any data at all. Also, is there a reason it's not using the initial $data object I'm passing to it to load onto the screen? Is there some way I can force it to do that? Thanks again! :)
Beta Was this translation helpful? Give feedback.
All reactions