Datatables new layout
This commit is contained in:
@@ -35,7 +35,9 @@ class ParentDataTable extends DataTable
|
||||
public function getHtmlButtons()
|
||||
{
|
||||
$buttons = '';
|
||||
|
||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-secondary btn-show mr-2"><i class="fa fa-fw fa-eye"></i></button>';
|
||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-leaf-alt"></i></button>';
|
||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-pencil-alt"></i></button>';
|
||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-danger btn-del"><i class="fa fa-fw fa-trash"></i></button>';
|
||||
return $buttons;
|
||||
@@ -47,7 +49,7 @@ class ParentDataTable extends DataTable
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->searchable(false)
|
||||
->width(80)
|
||||
->width(120)
|
||||
->addClass('text-center');
|
||||
}
|
||||
|
||||
@@ -87,32 +89,50 @@ class ParentDataTable extends DataTable
|
||||
->minifiedAjax()
|
||||
->dom($this->getDom())
|
||||
->orderBy(0,'asc')
|
||||
->buttons($this->getDatatablesButtons());
|
||||
->buttons(
|
||||
Button::make('export'),
|
||||
Button::make('print')
|
||||
);
|
||||
}
|
||||
|
||||
public function getParameters()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getDatatablesButtons()
|
||||
{
|
||||
$buttons = [];
|
||||
$buttons[] = Button::make('export');
|
||||
$buttons[] = Button::make('print');
|
||||
return $buttons;
|
||||
return [
|
||||
'pageLength' => 10
|
||||
];
|
||||
}
|
||||
|
||||
public function getDom()
|
||||
{
|
||||
$dom = $this->getDatatablesHeaderDefault();
|
||||
$dom .= "rt";
|
||||
$dom = '';
|
||||
// $dom .= $this->getDatatablesHeaderDefault();
|
||||
$dom .= "tr";
|
||||
$dom .= $this->getDatatablesFooterDefault();
|
||||
return $dom;
|
||||
}
|
||||
|
||||
public function getDatatablesHeader() {
|
||||
return view('components.datatables.header');
|
||||
}
|
||||
|
||||
public function getDatatablesHeaderDefault() {
|
||||
return "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>";
|
||||
// return "<div class'row'><div class='col'></div></div>";
|
||||
/*
|
||||
|
||||
$dom = 't<"row datatable-pager light"<"col-md-12"'
|
||||
. '<"datatable-more-export-buttons filter-buttons pull-left">'
|
||||
. '<"datatable-more-export-favorites-buttons filter-buttons pull-left">'
|
||||
. '<"datatable-more-export-basket-buttons filter-buttons pull-left">'
|
||||
. '<"datatable-download-buttons filter-buttons pull-left">'
|
||||
. '>>'
|
||||
. '<"dt-toolbar-footer"<"col"i><"col pull-right datatable-pager light nopadding-right"p>>';
|
||||
|
||||
*/
|
||||
|
||||
$dom = "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>";
|
||||
return $dom;
|
||||
// return 't<"row datatable-pager light"<"col-md-12"<"datatable-more-export-buttons filter-buttons pull-left"><"datatable-more-export-favorites-buttons filter-buttons pull-left"><"datatable-more-export-basket-buttons filter-buttons pull-left"><"datatable-download-buttons filter-buttons pull-left">>><"dt-toolbar-footer"<"col-md-6"i><"col-md-6 pull-right datatable-pager light nopadding-right"p>>';
|
||||
|
||||
}
|
||||
|
||||
public function getDatatablesFooterDefault() {
|
||||
|
||||
Reference in New Issue
Block a user