Open bbarclay opened 2 years ago
Please check the below link: https://github.com/MedicOneSystems/demo-livewire-datatables/blob/master/app/Http/Livewire/ActionsDemoTable.php
You will get the idea.
I am having the same problem. Something that should be very simple. Gives an error with Postgres.
Syntax error: 7 ERROR: syntax error at or near "`"
That is literally taking and copying the code you referred to him. As far as I can tell, two values are not possible with postgres. Is there any suggestions from the team or are we on our own to make ridiculous workarounds because we can only pass one value in callback.
You are 100% correct. I think this is the best option for tables but without the ability of passing two values with the callback option i have to start looking elsewhere for a solution. Which is a shame.
I will share the error. I didn't save it, but I'm going to try and update. Here is an example though, I think it should be in the documentation. because I was unable to pass two fields through a calback.
This produces a row with an image, a row with an external link that has an svg link image, and an internal link with the slug. I couldn't use the name because of that issue of passing two fieleds through. Also, there didn't seem to be an easy way to render an image.
-- LET ME NOTE: Callback functions are amazing, I just hope I can figure out how to pass a couple fields through. Also, I'm pretty sure that the query builder is broken for Postgres, but I'll update that in another issue.
I've tried 3 tables systems now. This has been the easiest to use so far.
`<?php
namespace App\Http\Livewire\Tables;
use App\Models\SiteAppCounts; use Mediconesystems\LivewireDatatables\Http\Livewire\LivewireDatatable; use Mediconesystems\LivewireDatatables\Column; class SiteAppCountsTable extends LivewireDatatable { public $model = SiteAppCounts::class; public $hideable = 'select'; public $exportable = true;
// return ''.$slugrpl.''; // link color blue return ''.$slugrpl.'';
} `