-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CollectionProvider] Returned columns are empty #26
Comments
I thought it might have been caused by 5cfce36, however reverting this commit still shows the issue. |
I found the cause. After adding the following to the list of if's inside if (is_object($data) && property_exists($data, 'attributes')) {
return $data->$name;
} I no longer get empty values returned. |
You can use the What about two options: Oh and we should write a test for that bug :) |
I will write a test for it in the morning. I want to find a more permanent/suitable solution than the one I have committed here too, if possible.
(Note that my register function inside DatatableServiceProvider has been edited to force VersionEngine to only use Datatable19Version (I could not find a way to nicely have ->view render with the datatable19.blade.php Datatable javascript, but that's a story for another feature request). You can use the Datatable::view() function, which will take a view as parameters. You still need to provide your columns, but maybe we can add a function on the view to set the view or even the version. |
@Chumper any idea for a better solution on timgws@8a1ff4f ? |
Add comment for test which ensures there is no regression on issue #26.
I have no answer offhand right now. I thought that a collection implements ArrayAccess and therefore should have a standard behaviour. I guess we need to experiment with the default function if you are not happy with the current solution. |
I am using d765c9f
Here is my controller code:
admin/test/categories.blade.php
has the following code:The endpoint works perfectly 👍
The AJAX request that is sent contains the following request parameters:
and the response is:
Note the empty
id
, andname
for each column, even though runningdd(Categories::all())
shows that there is infact data inside theCollection
.(Note that my
register
function insideDatatableServiceProvider
has been edited to forceVersionEngine
to only useDatatable19Version
(I could not find a way to nicely have->view
render with thedatatable19.blade.php
Datatable javascript, but that's a story for another feature request).The text was updated successfully, but these errors were encountered: