Category : datatable

I need to replace the function compileQuerySearch() from the yajra datatable vendor but I can’t seems to get it right … This is the original function <?php namespace YajraDataTables; use IlluminateDatabaseEloquentBuilder as EloquentBuilder; use IlluminateDatabaseQueryBuilder; use IlluminateDatabaseQueryExpression; use IlluminateSupportStr; use YajraDataTablesUtilitiesHelper; class QueryDataTable extends DataTableAbstract { // […] protected function compileQuerySearch($query, $column, $keyword, $boolean = ..

Read more

I’m using laravel 5.8 and datatables plugin( "yajra / laravel-datatables" ). it’s working fine. But when the amount of data is thousand plus or more, it’s becoming very slow to load the page. How can i fix this? How can I optimize the data load? Controller: $data= Registration::select(‘members.*’) ->leftJoin(‘payment’, ‘payment.user_id’, ‘=’, ‘members.email’) ->latest()->first()->get(); return Datatables::of($data) ..

Read more

i have code to build datatable with child datatable, and i use codeigniter to build my project, but it always error as this var KTDatatableChildRemoteDataDemo = function() { var demo = function() { var datatable = $(‘.kt-datatable’).KTDatatable({ data: { type: ‘remote’, source: { read: { url: ‘<?= base_url($c_name . ‘listdata’) ?>’, }, }, serverPaging: true, ..

Read more

Im using datatable with laravel 6, facing problem in a column that is not searchable, this column seems has array value, I want to return users privileges which sometimes can be more than one privilege (ex. manager, driver) but I don’t know why when I search for manager it shows not found controller: ->addColumn(‘permission’, function ..

Read more

I have the following function to get data into the DataTable with Laravel: public function landlordinvoices_orderbylandlord($period, $year) { $user = Auth::user(); return datatables()->of(Landlord::select(‘company_name’)->with(‘properties.files.invoices’)->where(‘office_id’, $user->office_id)->whereHas(‘properties.files.invoices’, function ($q) use($period, $year) { $q->where(‘period’, $period)->where(‘year’, $year)->where(‘paid_to_landlord’, 0); }))->toJson(); } This is working fine when I load the direct URL. But it’s not showing any data when I load it ..

Read more