Linked Questions

Popular Questions

I search set Column Class for laravel-datatables

Asked by At

In my laravel 5.7/ blade / jQuery v3.3.1 / Bootstrap v4.1.2 app

I use "yajra/laravel-datatables-oracle": "~8.0" library and when I need to change class of some rows depending on value of some field I do :

return Datatables
    ->setRowClass(function ($vote) {
        return $vote->status == 'N' ? ' row_new_status' : ($vote->status == 'I' ? 'row_inactive_status' : '');

It works ok, but I did not find any similar methods for columns. Are there ? Can it be implemented in some way ?

UPDATED # 1: In my blade file I define header of the table :

<div class="table-responsive">
    <table class="table table-bordered table-striped text-primary" id="get-warehouse-dt-listing-table">
            <th>Level count</th>
            <th>Created At</th>
            <th>Updated At</th>


but not generated rows. Or can I define it in blade? Please example, if yes.


Related Questions