Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Revaldo Pratama
    @revaldopratama
    hello @yajra
    kouloughli Hemza
    @kouloughli-hemza
    is this chart still working
    OskR219
    @OskR219
    Hi, does anybody know if I can get the documentation offline?
    Iip Muhamad Ikbal
    @iipmuhamadikbal
    hi
    i have a questions
    any body help me?
    Mathias E.
    @lk77
    hello, what's your question ?
    Iip Muhamad Ikbal
    @iipmuhamadikbal
    how to add title(headers) excel in laravel using yajra?
    I tried adding title but it's failed, not working, how to solve that?
    ->parameters([
    'dom' => 'Bfrtip',
    'order' => [[4, "desc"]],
    //'buttons' => ['excel', 'pdf', 'print'],
    'buttons' => [
    [
    'extend' => 'excel',
    'title' => "adjfadfjad"
    ],
    [
    'extend' => 'pdf'
    ],
    [
    'extend' => 'print',
    'title' => "adjfadfjad"
    ],
    ],
    ]);
    Gabriel Augusto "Patrola" Almeida
    @Gabrielpatrola
    hey i need some help
    my table is passing my layout
    image.png
    I'm tried to put responsive:true, widht="100%", div class="table-responsive"
    and none of them worked
    I tried*
    Can anyone help me?
    Gabriel Augusto "Patrola" Almeida
    @Gabrielpatrola
    @yajra
    TamangSanish
    @TamangSanish
    Hello can anybody provide me the idea on how to reorder the row of laravel backpack datatable??
    skys215
    @skys215
    does anyone here still uses laravel-datatables?
    Antoni Siek
    @ImJustToNy
    Hi, is it possible to pass parameters to view there?
    Luca
    @swim89

    Hi to everyone! Hi have a problem on orderColumn API. Here my code:
    return Datatables::eloquent(Company::query()) ->orderColumn('name', '`column` $1') ->make();

    But the generated query is: select * from ``companies`` where ``companies``.``deleted_at`` is null order by ``id`` asc limit 10 offset 0

    Can anyone help me?

    ezekel
    @ezekel
    @yajra are you still using this or you use other applicatliion like slack ?
    please send link, I think this channel is not active anymore ?
    lawyso
    @lawyso
    @iipmuhamadikbal have the same issue...did you manage it out?
    JanaShaaban
    @JanaShaaban
    Hi ...how can i link two datatable in API?
    Rayhan Yulanda
    @RayhanYulanda
    Multiple datatable in one page view given the same data
    im using datatable service
    Mathias E.
    @lk77
    hello, i made a reply to your issue, perhaps we need to add something about that on the doc
    Rayhan Yulanda
    @RayhanYulanda
    Yes, really need the documentation :(
    Still got an error :( @lk77
    still confuse how to get 2 datatable with tab using datatable service with the newest syntax T___T
    It really frustating because @yajra not noticed too :(
    Mathias E.
    @lk77
    it should work, try to look at the ajax response to see what is wrong.
    check if the name of the dataTable variable is matching
    Rayhan Yulanda
    @RayhanYulanda
    image.png
    it printed the script but i dont know why it said DataTables warning: table id=pensiundatatable - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
    Rayhan Yulanda
    @RayhanYulanda
    The response give view not json
    Rayhan Yulanda
    @RayhanYulanda
    public function frontend(Request $request, FrontendPensiunDataTable $pensiunDataTable, FrontendPangkatServiceDataTable $pangkatServiceDataTable){
            $pensiun_count = Pensiun::all()->count();
    
            if ($request->ajax() && request()->get('table') == 'pensiun')
                return $pensiunDataTable->render('frontend.welcome', ['pangkat'=>$pangkatServiceDataTable->html(),'pensiun'=>$pensiunDataTable->html(),'pensiun_count'=>$pensiun_count]);
            elseif ($request->ajax() && request()->get('table') == 'pangkat')
                return $pangkatServiceDataTable->render('frontend.welcome', ['pangkat'=>$pangkatServiceDataTable->html(),'pensiun'=>$pensiunDataTable->html(),'pensiun_count'=>$pensiun_count]);
    
            return $pensiunDataTable->render('frontend.welcome', [
                'pangkat'=>$pangkatServiceDataTable->html(),'pensiun'=>$pensiunDataTable->html(),
                'pensiun_count'=>$pensiun_count
                ]);
        }
    I try as you suggest but I modify it a little bit. another problem, the data displayed is exactly the same eventhough i call the different model
    @lk77
    Rayhan Yulanda
    @RayhanYulanda
    The view
    <div class="tab-pane fade show active" id="pills-pensiun" role="tabpanel" aria-labelledby="pills-pensiun-tab">
                        {!! $pensiun->table(['width' => '100%', 'id'=>'pensiundatatable']) !!}
                    </div>
                    <div class="tab-pane fade" id="pills-pangkat" role="tabpanel" aria-labelledby="pills-pangkat-tab">
                        {!! $pangkat->table(['width' => '100%', 'id'=>'pangkatdatatable']) !!}
    
                    </div>
    FrontendPangkatServiceDataTable
    class FrontendPangkatServiceDataTable extends DataTable
    {
        protected $dataTableVariable = 'pangkat';
        public function dataTable($query)
        {
            return datatables()
                ->eloquent($query)
                ;
        }
    
        public function query(JenisKenaikanPangkat $model)
        {
            $myModel = JenisKenaikanPangkat::query()->orderBy('id', 'DESC');
            return $this->applyScopes($myModel);
        }
    
        public function html()
        {
            return $this->builder()
                ->ajax(['data' => 'function(d) { d.table = "pangkat"; }'])
                ->parameters($this->getBuilderParameters())
                ->columns($this->getColumns())
                ->minifiedAjax()
                ->dom('frtip')
                ->addClass('table-responsive')
                ->languageSearchPlaceholder('Name')
                ;
        }
    
        protected function getColumns()
        {
            return [
                Column::make('nama'),
                Column::make('created_at'),
                Column::make('updated_at'),
            ];
        }
        protected function filename()
        {
            return 'Pangkat_' . date('YmdHis');
        }
    }
    FrontendPensiunDataTable
    protected $dataTableVariable = 'pensiun';
    public function query(Pensiun $model)
        {
            $myModel = Pensiun::query()->orderBy('id', 'DESC');
            return $this->applyScopes($myModel);
        }
    did i miss something? @lk77
    the script i just put this
    {!! $pensiun->scripts() !!}
    {!! $pangkat->scripts() !!}
    Rayhan Yulanda
    @RayhanYulanda
    Rayhan Yulanda
    @RayhanYulanda
    i got the problem now. the problem is request()->get('table') not sent via ajax. any suggestion?
    Rayhan Yulanda
    @RayhanYulanda
    I solved it
    Remove ->minifiedAjax() and it works
    Thanks for helping @lk77
    Rayhan Yulanda
    @RayhanYulanda
    1. Is there an option for using order in raw column with datatable service?
    2. How to search and orderable with joining query? I'm stuck with this prob for 2 days
    shiva2k2
    @shiva2k2
    How to add extra columns to User table in Laravel 6 built on yajra tables
    1 reply