singlequote / Laravel-datatables

This repo contains a Datatable that can render a filterable and sortable table. It aims to be very lightweight and easy to use. It has support for retrieving data asynchronously, pagination and recursive searching in relations.
https://singlequote.github.io/Laravel-datatables/
MIT License
18 stars 6 forks source link

How to distinguish between column info and text for labels/links et. al? #51

Closed happymacarts closed 2 years ago

happymacarts commented 2 years ago

I have a user table with a hasMany relation to 'online_requests' which has a hasOne relation to a 'onlineRequestType' which has a name field that i would like to use in the "title" of my link

I am trying to do this

Multiple::make('online_requests')->each('online_requests', function () {
    return [
        Label::make('id')
            ->title("View {onlineRequestType.name}", 'tooltip')
            ->class('ViewORnBtn btn btn-sm btn-info my-1')
            ->data(['id' => 'id']),

    ];
})

public function query($query)
    {
        return $query->with('roles','onlineRequests', 'onlineRequests.onlineRequestType');
    }

any suggestions on how to use nested relations in the tooltip?

wimurk commented 1 year ago

Hi @happymacarts this isnt possible yet. Might be a good update tho.