Category : datatable

I am currently using Datatable in my laravel project for displaying my day configuration from my database. I would like to display my data in the following order, Monday -> Tuesday -> Wednesday etc. Currently it is being ordered by alphabetical order from my database where the day column is store as string. Below are ..

Read more

In laravel 5.8 app with DataTables 1.10.22 I need to add message No data available in table If there are no rows in result set Searching for decision I added emptyTablein table definition : $(‘#invoices’).DataTable({ rowReorder: true, responsive: true, "aaSorting": [], "emptyTable": "no data available in table.", "initComplete": function(settings, json) { $(this).removeClass("no-footer"); } }); But ..

Read more

I’m about to pass the checked columns from Child Component on my Parent Component through $emit. Then I was able to get the passed value. Here’s the example of my Child Component:Child.vue <div class="custom-control custom-control-sm custom-checkbox"> <input type="checkbox" class="custom-control-input sc-modal-body-form-check1-input" id="col-foo1" value="foo1" v-model="fooColumns"> <label class="custom-control-label sc-modal-body-form-check1-label" for="col-type">Foo 1</label> </div> <div class="custom-control custom-control-sm custom-checkbox"> <input type="checkbox" ..

Read more

I’m about to pass the checked columns from Child Component to my Parent Component through $emit. Then I was able to get the passed value. Here’s the example of my Child Component:Child.vue <div class="custom-control custom-control-sm custom-checkbox"> <input type="checkbox" class="custom-control-input sc-modal-body-form-check1-input" id="col-foo1" value="foo1" v-model="fooColumns"> <label class="custom-control-label sc-modal-body-form-check1-label" for="col-type">Foo 1</label> </div> <div class="custom-control custom-control-sm custom-checkbox"> <input type="checkbox" ..

Read more

I’m using Laravel and Livewire for the first time, so apologize if the question is silly. I’ve read from Livewire documentation https://laravel-livewire.com/docs/2.x/events that Livewire components can communicate with each other through a global event system. As long as two Livewire components are living on the same page, they can communicate using events and listeners. I ..

Read more

I have a problem when I want to display and sort Users data from database to data table. My console doesn’t show any errors either This is my Controller in Laravel public function data(Request $request) { $orderBy = ‘users.id’; switch ($request->input(‘order.0.column’)) { case "0": $orderBy = ‘users.id’; break; case "1": $orderBy = ‘users.name’; break; case ..

Read more

I’m trying to store data into database by ajax request and display stored data in datatable wihtout reloading the page. My form data is stored perfectly but table row does not add perfectly. Here is my form <form id="videoAddForm" method="POST" enctype="multipart/form-data"> @csrf <div class="modal-body"> <div class="col-xl-12 col-md-12"> <div class="ms-form-group"> <label for="name">Name</label> <input type="text" class="form-control" name="name" ..

Read more

I try to use editor datatable trial fot my work. I follow this tuto but I can’t get the editor buttons to work. I got this error when i add the editor function in the html function on my ClientsDataTable : $.fn.dataTable.Editor is not a constructor See my code index.blade.twig : @extends(‘dashboard.base’) @section(‘css’) /*<link rel="stylesheet" ..

Read more

Is there a way to order a datatable by an added column? I couldn’t figure it out . Example: return datatables()->of(Restaurant::select(‘id’,’denumire’)->where(‘id_stare’,1)->with([‘orders’=> function($q) use($startDate, $endDate){ $q->where(‘created_at’, ‘>=’,$startDate->toDateTimeString())->where(‘created_at’, ‘<=’,$endDate->toDateTimeString()); }]) ) ->addIndexColumn() ->addColumn(‘suma’, function(Restaurant $restaurant) { $suma = $restaurant->orders->sum(function($item){ return $item->total; }); return intval($suma); }) ->make(true); In front i use the JavaScript DataTable framework , but the ..

Read more

How do I sort according to the second data? The sorting works only on the ID. But in my table, I added a badge count and thats what I want to sort. Here is my controller return DataTables::of($users) ->addIndexColumn() ->addColumn(‘Inventories’, function ($row) { if($row->status != ‘Dumped2’) { return ‘<a href="’.route(‘admin.clients.show-client-inventories2′, $row->id).’" class="btn btn-info btn-sm">’.__("Inventories").’ <span ..

Read more

I want to store data in database using ajax & want to display stored data into blade without refreshing the page. Data is stored successfully but I don’t know how to load data without refreshing the page. Here is my controller code $product= Product::create([ ‘title’ => $request->title, ‘description’ => $request->description, ]); $data = array(); $data[‘success’] ..

Read more

I have datatable that show user task. I’ve created the filter for KPI table to show specific KPI (Yes or No). The problem is when I use get() method I can’t filter with the dropdown, and if I replace get() using latest() $data = Post::where(‘user_id’, Auth::user()->uid)->latest();or remove it $data = Post::where(‘user_id’, Auth::user()->uid);, my datatable can’t ..

Read more

I’m trying to check compability of my Laravel 8 project, I have datatables with route ajax: { url: "/detail/" + user_id, data: function(d) { d.kpi = $(‘#filter-kpi’).val(), d.search = $(‘input[type="search"]’).val() } }, when I acces it from artisan serve, it works pretty well (http://127.0.0.1:8000/detail/1000000004). But, when I access it using apache server in XAMPP (http://localhost/project-management-main/public/detail/1000000004), ..

Read more