【问题标题】:backpack for laravel column widthlaravel 列宽的背包
【发布时间】:2017-11-07 20:35:10
【问题描述】:

是否可以减少 laravel 的背包 crud 中某些列的列宽,添加列中是否有任何属性允许这样做?

在显示的图像上,我想将 1s 换成 glyphicon-ok,但我找不到方法

public function setup(){

    $this->crud->setModel("App\ReporteParamEstacion");
    $this->crud->setRoute("admin/reporte_paramestacion");
    // $this->crud->setRouteName("crud.reportes.listado_importacion");
    $this->crud->setEntityNameStrings('parametro estacion', 'parametro estaciones');
    $this->crud->enableExportButtons();
    $this->crud->removeAllButtons();

     $this->crud->addColumn([
     'name' => 'nombre',
     'label' =>'Estacion',
     'type' => 'text'
    ]);

    $this->crud->addColumn([
     'name' => 'nombre_comuna',
     'label' =>'Comuna',
     'type' => 'text'
    ]);

    $this->crud->addColumn([
     'name' => 'MP10',
     'label' =>'MP10',
     'type' => 'text'


    ]);

    $this->crud->addColumn([
     'name' => 'MP25',
     'label' =>'MP25',
     'type' => 'text'

    ]);

    $this->crud->addColumn([
     'name' => 'SO2',
     'label' =>'SO2',
     'type' => 'text'
    ]);

    $this->crud->addColumn([
     'name' => 'NO2',
     'label' =>'NO2',
     'type' => 'text'
    ]); 

     $this->crud->addColumn([
     'name' => 'CO',
     'label' =>'CO',
     'type' => 'text'

    ]);  

    $this->crud->addColumn([
     'name' => 'O3',
     'label' =>'O3',
     'type' => 'text'
    ]);

    $this->crud->addColumn([
     'name' => 'BC',
     'label' =>'BC',
     'type' => 'text'
    ]);   

     $this->crud->addColumn([
     'name' => 'NOX',
     'label' =>'NOX',
     'type' => 'text'
    ]);  
 }

提前致谢

【问题讨论】:

标签: laravel-5 laravel-backpack


【解决方案1】:

将类型设置为“检查”,如下所示:

[ 'name' => 'mp10', // The db column name 'label' => "MP10", // Table column heading 'type' => 'check' ]

【讨论】:

  • 也可以减少列宽吗?
  • 我不得不改变类型检查,因为我在导出 PDF 时遇到问题,似乎图标无法导出为 pdf
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-04-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-12-16
相关资源
最近更新 更多