Lançado Adianti Framework 7.6!
Clique aqui para saber mais
Ajuda com Datagrid com scroll horizontal Ainda com problema com esse modulo... alguem para ajudar??? pois tenho uma tabela com varios campos e peguei esse exemplo e testei. Para meu espanto, mesmo como exemplo no tutor nao está aparecendo a barra de rolagem horizontal como no video explicativo... ...
M
Ajuda com Datagrid com scroll horizontal  
Ainda com problema com esse modulo... alguem para ajudar??? pois tenho uma tabela com varios campos e peguei esse exemplo e testei. Para meu espanto, mesmo como exemplo no tutor nao está aparecendo a barra de rolagem horizontal como no video explicativo...



  1. <?php
  2.     /**
  3.      * DatagridHScrollView
  4.      *
  5.      * @version    1.0
  6.      * @package    samples
  7.      * @subpackage tutor
  8.      * @author     Pablo Dall'Oglio
  9.      * @copyright  Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
  10.      * @license    http://www.adianti.com.br/framework-license
  11.      */
  12.     class DatagridHScrollView extends TPage
  13.     {
  14.         private $datagrid;
  15.         
  16.         public function __construct()
  17.         {
  18.             parent::__construct();
  19.             
  20.             // creates one datagrid
  21.             $this->datagrid = new BootstrapDatagridWrapper(new TQuickGrid);
  22.             $this->datagrid->style 'width: 1600px';
  23.             
  24.             // add the columns
  25.             $this->datagrid->addQuickColumn('Code',    'code',    'center');
  26.             $this->datagrid->addQuickColumn('Name',    'name',    'left');
  27.             $this->datagrid->addQuickColumn('Address''address''left');
  28.             $this->datagrid->addQuickColumn('Phone',   'fone',    'left');
  29.             $this->datagrid->addQuickColumn('Email',   'email',   'left');
  30.             $this->datagrid->addQuickColumn('City',    'city',    'left');
  31.             $this->datagrid->addQuickColumn('State',   'state',   'left');
  32.             $this->datagrid->addQuickColumn('Country''country''left');
  33.             
  34.             $action1 = new TDataGridAction(array($this'onView'));
  35.             $this->datagrid->addQuickAction('View',   $action1, ['code''name'], 'fa:search blue');
  36.             
  37.             // creates the datagrid model
  38.             $this->datagrid->createModel();
  39.             
  40.             $panel = new TPanelGroup(_t('Horizontal Scrollable Datagrids'));
  41.             $panel->add($this->datagrid);
  42.             $panel->addFooter('footer');
  43.             
  44.             // turn on horizontal scrolling inside panel body
  45.             $panel->getBody()->style "overflow-x:auto;";
  46.             
  47.             // wrap the page content using vertical box
  48.             $vbox = new TVBox;
  49.             $vbox->style 'width: 100%';
  50.             $vbox->add(new TXMLBreadCrumb('menu.xml'__CLASS__));
  51.             $vbox->add($panel);
  52.             parent::add($vbox);
  53.         }
  54.         
  55.         /**
  56.          * Load the data into the datagrid
  57.          */
  58.         function onReload()
  59.         {
  60.             $this->datagrid->clear();
  61.             
  62.             // add an regular object to the datagrid
  63.             $item = new StdClass;
  64.             $item->code     '1';
  65.             $item->name     'Fábio Locatelli Soares';
  66.             $item->address  'Rua Expedicionario, 300';
  67.             $item->fone     '1111-1111';
  68.             $item->email    'fabio@email.com';
  69.             $item->city     'Grand Lajeado';
  70.             $item->state    'South Big River';
  71.             $item->country  'Brazil';
  72.             $this->datagrid->addItem($item);
  73.             
  74.             // add an regular object to the datagrid
  75.             $item = new StdClass;
  76.             $item->code     '2';
  77.             $item->name     'Julia Haubert';
  78.             $item->address  'Rua Expedicionarios';
  79.             $item->fone     '2222-2222';
  80.             $item->email    'julia@email.com';
  81.             $item->city     'Grand Lajeado';
  82.             $item->state    'South Big River';
  83.             $item->country  'Brazil';
  84.             $this->datagrid->addItem($item);
  85.             
  86.             // add an regular object to the datagrid
  87.             $item = new StdClass;
  88.             $item->code     '3';
  89.             $item->name     'Carlos Ranzi';
  90.             $item->address  'Rua Oliveira';
  91.             $item->fone     '3333-3333';
  92.             $item->email    'carlos@email.com';
  93.             $item->city     'Grand Lajeado';
  94.             $item->state    'South Big River';
  95.             $item->country  'Brazil';
  96.             $this->datagrid->addItem($item);
  97.             
  98.             // add an regular object to the datagrid
  99.             $item = new StdClass;
  100.             $item->code     '4';
  101.             $item->name     'Daline DallOglio';
  102.             $item->address  'Rua Oliveira';
  103.             $item->fone     '4444-4444';
  104.             $item->email    'daline@email.com';
  105.             $item->city     'Grand Lajeado';
  106.             $item->state    'South Big River';
  107.             $item->country  'Brazil';
  108.             $this->datagrid->addItem($item);
  109.         }
  110.         
  111.         /**
  112.          * method onView()
  113.          * Executed when the user clicks at the view button
  114.          */
  115.         function onView($param)
  116.         {
  117.             // get the parameter and shows the message
  118.             $code $param['code'];
  119.             $name $param['name'];
  120.             new TMessage('info'"The code is: <b>$code</b> <br> The name is : <b>$name</b>");
  121.         }
  122.         
  123.         /**
  124.          * shows the page
  125.          */
  126.         function show()
  127.         {
  128.             $this->onReload();
  129.             parent::show();
  130.         }
  131.     }

Curso completo Meu Negócio Pronto
Use para si, ou transforme em um negócio: Inclui aulas e códigos-fontes
Gestor de conteúdo (SITE) + Loja Virtual (E-Commerce) + Emissor de Notas para infoprodutos


Meu negócio pronto Quero me inscrever agora!

Comentários (2)


NR

Teste o seguinte:
  1. <?php
  2. $this->datagrid->style 'width: 1600px;max-width: 1600px';
  3. ?>
M

Funcionou...

Obrigado pela força...