aginev / datagrid Goto Github PK
View Code? Open in Web Editor NEWDatagrid for Laravel v5
License: MIT License
Datagrid for Laravel v5
License: MIT License
When you have variable like $client->country->region->title and country is null, there is an error in ModelRow.php with undefined property. Right behavior of grid is to print just empty string "".
Your code is:
// The easiest way to chain the object properties
foreach ($keys as $key) {
$value = $value->{$key};
}
The right code is:
// The easiest way to chain the object properties
foreach ($keys as $key) {
$value = $value->{$key};
if (is_null($value)) {
break;
}
}
Please apply that to your code
Hi,
I'm using this datagrid, and setting it the same with your example. But the filter and sort it's not working. But when I search or sort, the link will change into http://localhost/17fit_studio/webadmin/rights?f%5Border_by%5D=role_id&f%5Border_dir%5D=DESC&page=1 But the data not change..
Can you help me?
$functions = WebAdmin::all();
$grid = new \Datagrid($functions, Request::get('f', []));
thanks
When you use own filter form and send this filter form to get url like /orders?surname=Ginev and then click on sorting the grid ends up in start state. This feature will be very helpfull to others too.
Datagrid.php line 354 - instead:
$filters->toArray(), 'page' => 1, 'per_page' => $per_page]
change to:
$filter = ['f' => $filters->toArray(), 'page' => 1, 'per_page' => $per_page];
return empty($_GET) ? $filter : array_merge($_GET, $filter);
Im trying to use your datagridder, but the sorting and filtering aint working.
Sorting does the GET request but nothing happens.
Filtering won't even make the GET request.
Edit nvm, you need to write your own queries to filter.
Keep up the good work.
Hi,
I tried to use your package, but I was unable to do, as I don't know which Javascript from Datagrad I should use.
Could you extend your explanation with that?
Thanks would be very helpful.
Thanks
kay899
I am using this package in larave 5.7.
Sorting and filteration is not working.
i use this datagrid in my project
i have this error in all of my pages in project :
count(): Parameter must be an array or an object that implements Countable
in setRow() in Datagrid.php
why this happens?
Do you have a demo site anywhere that you can show
This is very strange behavior. Empty condition is always true even if variable is for example 5.
'wrapper' => function ($value, $row) {
if (empty($row->created_by)) {
return '';
}
This works fine
'wrapper' => function ($value, $row) {
if ( ! $row->created_by) {
return '';
}
It is not possible to set HTML title for non-sortable columns:
->setColumn('name', '<strong>Name</strong>')
.
For sortable columns everything is OK.
How to fix
Change Views/grid.blade.php line 28 from {{ $col->getTitle() }}
to {!! $col->getTitle() !!}
In the example the destroy/delete link has the data-method=DELETE
attribute and data-confirm
attribute set. Apparently these are not used when embedding the gridview in a plain blade template.
Is this as intended and do I need to add the relevant Javascript from somewhere else or did I miss a requirement in my composer.json?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.