示例#1
0
 /**
  * @param Context $db
  * @param Selection $selection
  */
 public function __construct(Context $db, Selection $selection)
 {
     parent::__construct();
     $this->db = $db;
     $this->selection = $selection;
     $this->prepare();
 }
示例#2
0
 public function __construct($parent, $name)
 {
     parent::__construct($parent, $name);
     $this->user = $parent->user->getIdentity();
     $this->settings = $this->user->settings;
     $this->setTranslator(new \Grido\Translations\FileTranslator('cs'));
     //$this->setDefaultPerPage($this->settings["table_rows"]);
     $this->tablePrototype = \Nette\Utils\Html::el('table');
     $this->tablePrototype->id($this->getName())->class[] = 'table table-striped table-hover';
     $this->setExport();
 }
示例#3
0
文件: Grid.php 项目: cothema/grid
 /**
  *
  * @param \Nette\ComponentModel\IContainer $parent
  * @param string $name
  */
 public function __construct(\Nette\ComponentModel\IContainer $parent = NULL, $name = NULL)
 {
     parent::__construct($parent, $name);
     $translator = $parent->translator;
     if ($translator instanceof \Kdyby\Translation\Translator) {
         $lang = $translator->getLocale();
         $gridLang = $lang === 'cz' ? 'cs' : 'en';
         $this->getTranslator()->setLang($gridLang);
     }
     $this->setTemplateFile(__DIR__ . '/templates/fresh.latte');
     $this->getTemplate()->extendsFile = DIR_VENDOR . '/o5/grido/src/templates/default.latte';
     $this->filterRenderType = Filter::RENDER_INNER;
     $this->setExport();
 }