Lançado Adianti Framework 7.6!
Clique aqui para saber mais
menu

Adianti Solutions

API

Adianti, Framework, PHP, MVC, Active record, Front controller, IDE, RAD, Web, multiplataforma, geração de código, desenvolvimento rápido, relatórios, formulários, listagens, datagrids, gráficos, banco de dados, padrões de projeto, design patterns API do Adianti Framework.
API Docs
code
Selecione a classe

Source for file BootstrapDatagridWrapper.php

Documentation is available at BootstrapDatagridWrapper.php

  1. <?php
  2. namespace Adianti\Wrapper;
  3. use Adianti\Widget\Datagrid\TDataGrid;
  4.  
  5. /**
  6.  * Bootstrap datagrid decorator for Adianti Framework
  7.  *
  8.  * @version    7.4
  9.  * @package    wrapper
  10.  * @author     Pablo Dall'Oglio
  11.  * @copyright  Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
  12.  * @license    http://www.adianti.com.br/framework-license
  13.  * @wrapper    TDataGrid
  14.  * @wrapper    TQuickGrid
  15.  */
  16. {
  17.     private $decorated;
  18.     
  19.     /**
  20.      * Constructor method
  21.      */
  22.     public function __construct(TDataGrid $datagrid)
  23.     {
  24.         $this->decorated $datagrid;
  25.         $this->decorated->{'class''table table-striped table-hover';
  26.         $this->decorated->{'type'}  'bootstrap';
  27.     }
  28.     
  29.     /**
  30.      * Clone datagrid
  31.      */
  32.     public function __clone()
  33.     {
  34.         $this->decorated clone $this->decorated;
  35.     }
  36.     
  37.     /**
  38.      * Redirect calls to decorated object
  39.      */
  40.     public function __call($method$parameters)
  41.     {
  42.         return call_user_func_array(array($this->decorated$method),$parameters);
  43.     }
  44.     
  45.     /**
  46.      * Redirect calls to decorated object
  47.      */
  48.     public function __set($property$value)
  49.     {
  50.         $this->decorated->$property $value;
  51.     }
  52.     
  53.     /**
  54.      * Redirect calls to decorated object
  55.      */
  56.     public function __get($property)
  57.     {
  58.         return $this->decorated->$property;
  59.     }
  60.     
  61.     /**
  62.      * Shows the decorated datagrid
  63.      */
  64.     public function show()
  65.     {
  66.         $this->decorated->{'style'.= ';border-collapse:collapse';
  67.         
  68.         $sessions $this->decorated->getChildren();
  69.         if ($sessions)
  70.         {
  71.             foreach ($sessions as $section)
  72.             {
  73.                 unset($section->{'class'});
  74.                 
  75.                 $rows $section->getChildren();
  76.                 if ($rows)
  77.                 {
  78.                     foreach ($rows as $row)
  79.                     {
  80.                         if ($row->{'class'== 'tdatagrid_group')
  81.                         {
  82.                             $row->{'class''info';
  83.                             $row->{'style'$row->{'style'';user-select:none';
  84.                         }
  85.                         else
  86.                         {
  87.                             unset($row->{'class'});
  88.                             
  89.                             if (!empty($row->{'className'}))
  90.                             {
  91.                                 $row->{'class'$row->{'className'};
  92.                             }
  93.                         }
  94.                     }
  95.                 }
  96.             }
  97.         }
  98.         $this->decorated->show();
  99.     }
  100. }