Category : datatable

how can i get branch_id value but with different program_id condition? $data = Peserta::where(‘branch_id’,$branch_id) ->select(‘program_id’)->distinct() ->with(‘program’,’branch’); return DataTables::of($data) ->addColumn(‘program’, function ($data) { return $data->program->name; }) ->addColumn(‘action’, function ($data) { $btn = ‘<a href="/halaman-data-peserta-berdasarkan-cabang-dan-program/’.$branch_id.’/’.$data->program->id.’" class="btn btn-sm btn-info"> check </a>’; return $btn; }) ->rawColumns([‘program’,’action’]) ->make(true); Sourc..

Read more

The current search input of the datatables using Yajra is just accepting string/numbers that contains with, not starts with. I wanted to make it search by Starts With. Yajra Datatables has a snippet in their docs but I doen’t understand a thing on how to use it: https://yajrabox.com/docs/laravel-datatables/master/starts-with-search Does anyone know how to use this? ..

Read more

I get the serverside data from controller, and get data using ajax. This is my datatable script. // Data table var table = $(‘.data-table’).DataTable({ processing: true, serverSide: true, responsive: true, ajax: "quotation", dom: ‘<"top"fB>rt<"bottom"lip><"clear">’, columns: [{ data: ‘quotation_no’, name: ‘quotation_no’ }, { data: ‘remarks’, name: ‘remarks’ }, { data: ‘quotation_date’, name: ‘quotation_date’ }, { data: ..

Read more

The exit status code ‘127’ says something went wrong: stderr: "sh: /usr/bin/wkhtmltopdf: not found " stdout: "" command: /usr/bin/wkhtmltopdf –lowquality –margin-bottom ’10mm’ –margin-left ‘0’ –margin-right ‘0’ –margin-top ’10mm’ –orientation ‘landscape’ –no-outline ‘/tmp/knp_snappy61546419828074.33085429.html’ ‘/tmp/knp_snappy615464198289a1.61220237.pdf’. How do I resolve this error? which wkhtmltopdf snappy config Sourc..

Read more

Edit and delete button not working with jquery datatable in vue js.Cannot create button on td tag in template,have to create those buttons in jquery function.Bellow is my delete button code. getTests() { this.$http.get(‘http://127.0.0.1:8000/api/getTest’) .then((response) => { $("#myTable").DataTable({ data: response.data.columns, columns: [ { data: "id" }, { data: "name" }, { data: "price" }, { ..

Read more

I am using datatable in Laravel Project. I use it on many pages. But on two pages I need to show almost 20 columns. and it automatically adds a plus sign to show more details. I have filters on table and following is my JavaScript. $(document).ready(function() { initDatatable(‘/deals/deals_table’, ‘deals_table’); }); function quickFilter(elementId) { var fnServerParams ..

Read more

Hellooo i am using a datatable with laravel and I have the following doubt … $query = DB::table(‘categories’)->select(‘id’,’name’,’parent_id’)->orderBy(‘id’); I have this code that returns me all the categories … columns: [ { data: ‘id’ }, { data: ‘image’, render: function ( data, type, row ) { return data ? ‘<img src="/images/product/’+data+’" height="80" width="80">’ : ‘<img ..

Read more

Hi i am working on a Laravel project and setup relationship between the following tables permissions table permissions_modules public function moduleAddPermissions(Request $request, $id) { $model = PermissionsModule::with(‘module_permissions’)->find($id); if ($request->ajax()) { return Datatables::of($model ? [$model] : []) ->addIndexColumn() ->make(true); } return view(‘admin.users.permissions.module_permissions_create’, compact(‘model’)); } what i am trying to do here is open a Module detail ..

Read more

I used Datatables in laravel and getting above warning message Here is my Datatable controller class DatatableController extends Controller { public function index(Request $request) { if ($request->ajax()) { $data = User::select(‘*’); return Datatables::of($data) ->addIndexColumn() ->addColumn(‘action’, function($row){ $btn = ‘<a href="javascript:void(0)" class="edit btn btn-primary btn-sm">View</a>’; return $btn; }) ->rawColumns([‘action’]) ->make(true); } return view(‘datatable’); } } Route ..

Read more