Open jlopes90 opened 2 years ago
I made the changes more or less and it works fine.
to
public function setColumnAttributes(): void
{
$columns = $this->options->columns();
if ($columns) {
foreach ($columns as $key => $attr) {
$index = $attr['data']['_'] ?? $attr['data'];
if ($index === 'function') {
$index = $key;
}
if ($this->columns->visible()->isExists($index)) {
$this->columns->visible()->get($index)->attr = $attr;
}
}
}
}
to
protected function orderBy(): string
{
...
foreach ($orders as $order) {
$data = $this->options->columns()[$order['column']]['data'];
$id = $data['sort'] ?? $data['_'] ?? $data;
if ($id === 'function') {
$id = $order['column'];
}
if ($this->columns->visible()->isExists($id)) {
$o[] = $this->columns->visible()->get($id)->name.' '.$order['dir'];
}
}
...
}
I use
data: function(row)
and it works but sorting doesn't work.Example: