mesour / laravel-sandbox Goto Github PK
View Code? Open in Web Editor NEWSandbox for Mesour DataGrid using mesour/laravel-bridges
Sandbox for Mesour DataGrid using mesour/laravel-bridges
Dedicated source that extends that class.
<?php namespace Modules\Core\Http\ViewComposers\Admin\Site;
use Modules\Core\Entities\Site as SiteEntity;
use LaravelDoctrine\ORM\Facades\EntityManager;
use Modules\Core\Mesour\DataGrid\Sources\DoctrineGridSource;
class DataGridSource extends DoctrineGridSource {
public function __construct() {
$qb = EntityManager::createQueryBuilder();
$qb
->select('s','c')
->from(SiteEntity::class, 's')
->join('s.creator','c');
parent::__construct(SiteEntity::class,'id',$qb);
}
}
Example of the Laravel view composer that puts it all together.
<?php namespace Modules\Core\Http\ViewComposers\Admin\Site;
use Illuminate\View\View;
use Doctrine\ORM\EntityManagerInterface;
use Mesour\Bridges\Laravel\ApplicationManager;
use Mesour\UI\DataGrid;
class DataGridComposer {
protected $uiApp;
public function __construct(ApplicationManager $uiApp) {
$this->uiApp = $uiApp;
}
public function compose(View $view) {
$source = new DataGridSource();
$grid = new DataGrid('sites',$this->uiApp->getApplication());
$grid->setSource($source);
$grid->enablePager(10);
$grid->enableFilter(true);
$grid->addText('id','ID');
$grid->addText('machineName','Machine Name');
$grid->addText('creator','Creator')->setFiltering(false)->setOrdering(false)->setCallback(function($col,$site) {
return $site['creator']['email'];
});
$grid->addDate('createdAt','Created');
$grid->addDate('updatedAt','Updated');
$view->with('grid',$grid);
}
}
This might be a good recipe for others who also don't want to define a strategy on every entity for array conversion.
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.