-
Notifications
You must be signed in to change notification settings - Fork 154
id problems #328
Comments
You should be able to use Datatable::query, there should be no need to use a collection for this use case. ---- On Thu, 27 Aug 2015 20:49:25 +1000 [email protected] wrote ---- I am trying to get the id from my database table to show on my datatable. I have tried
I have also tried
my front end code is
All give me an error Warning: table id = adminprop |
I have just changed this and I am still getting the same error. return Datatable::query($properties) I have just tried same error, I also then realized that the error I gave you meant nothing this is the response from ajax call file: "C:\lamp\www\in2assets\vendor\chumper\datatable\src\Chumper\Datatable\Engines\CollectionEngine.php" With Collection And file: "C:\lamp\www\in2assets\vendor\chumper\datatable\src\Chumper\Datatable\Engines\QueryEngine.php" with Query |
Hey Erich, Sorry for the short reply earlier, I was on my phone (and also on a holiday!). Please make sure that with
|
Hi. And order column, also not working |
@ErichNiem could you please let me know what version you have in your composer file? |
I am trying to get the id from my database table to show on my datatable.
So far I have tried
I have tried
return Datatable::collection(new Collection($properties))
->addColumn('id', function($Property){
return $Property->property_id;
})
->showColumns('reference', 'listing_type')..............
I have also tried
return Datatable::collection(new Collection($properties))
->showColumns(
['property_id' => 'ID', 'reference' => 'Reference', 'listing_type' => 'Listing Type'])
->addColumn('street_address', function($Property){
return $Property->complex_number . ' ' . $Property->complex_name . ' ' . $Property->street_number . ' ' . $Property->street_address;
}).............
my front end code is
{{ Datatable::table()
// these are the column headings to be shown
->addColumn('ID', 'Reference', 'Listing Type', 'Street Address', 'Province', 'Suburb', 'Property Type', 'User Name', 'Vetting Status', 'Action')
// this is the route where data will be retrieved
->setUrl(route('api.adminproperty', ['status' => $status]))
->setId('adminpropDatatable')
->render() }}
All give me an error
Warning: table id = adminprop
Please note, adding the id was an after thought, everything was working perfectly.
The text was updated successfully, but these errors were encountered: