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

Curso Dominando o Adianti Framework

O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado!


Dominando o Adianti Framework 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...