/** * Shows the DataGrid */ function show() { // shows the datagrid parent::show(); $params = $_REQUEST; unset($params['class']); unset($params['method']); // to keep browsing parameters (order, page, first_page, ...) $urlparams = '&' . http_build_query($params); // inline editing treatment TScript::create(" tdatagrid_inlineedit( '{$urlparams}' );"); TScript::create(" tdatagrid_enable_groups();"); }
/** * Shows the DataGrid */ function show() { // shows the datagrid parent::show(); $params = $_REQUEST; unset($params['class']); unset($params['method']); // to keep browsing parameters (order, page, first_page, ...) $urlparams = '&' . http_build_query($params); // inline editing treatment TScript::create('$(function() { $(".inlineediting").editInPlace({ callback: function(unused, enteredText) { __adianti_load_page($(this).attr("action")+"' . $urlparams . '&key="+$(this).attr("key")+"&field="+$(this).attr("field")+"&value="+encodeURIComponent(enteredText)); return enteredText; }, show_buttons: false, text_size:20, params:column=name }); });'); }
/** * Show the notebook at the screen */ public function show() { // count the pages $pages = $this->getPageCount(); // creates a table $note_table = new TTable(); $note_table->{'width'} = $this->width; $note_table->{'border'} = 0; $note_table->{'cellspacing'} = 0; $note_table->{'cellpadding'} = 0; $note_table->{'class'} = 'notebook-table'; // add a row for the tabs $row = $note_table->addRow(); $i = 0; $id = $this->id; // get javascript code to show/hide sub-notebooks $subnotes_hide = $this->_getHideCode(); $subnotes_show = $this->_getShowCode(); if ($this->pages) { // iterate the tabs, showing them foreach ($this->pages as $title => $content) { // verify if the current page is to be shown $classe = $i == $this->currentPage ? 'tnotebook_aba_sim' : 'tnotebook_aba_nao'; // add a cell for this tab if ($this->tabsVisibility) { $cell = $row->addCell(" {$title} "); $cell->{'class'} = $classe; $cell->id = "aba_{$id}_{$i}"; $cell->height = '23px'; $cell->onclick = $subnotes_hide . "tnotebook_hide('{$id}', {$pages});" . "tnotebook_show_tab('{$id}',{$i});" . $this->getShowPageCode($title); // show only this page sub-contents if ($this->tabAction) { $this->tabAction->setParameter('current_page', $i + 1); $string_action = $this->tabAction->serialize(FALSE); $cell->onclick = $cell->onclick . "__adianti_ajax_exec('{$string_action}')"; } $cell->onmouseover = "javascript:tnotebook_prelight(this, '{$id}', {$i})"; $cell->onmouseout = "javascript:tnotebook_unprelight(this, '{$id}', {$i})"; // creates the cell spacer $cell = $row->addCell(' '); $cell->{'class'} = 'tnotebook_spacer'; $cell->width = '3px'; $i++; } } } // creates the cell terminator $cell = $row->addCell(' '); $cell->{'class'} = 'tnotebook_end'; if ($this->tabsVisibility) { $row = $note_table->addRow(); $row->height = '7px'; $cell = $row->addCell('<span></span>'); $cell->{'class'} = 'tnotebook_down'; $cell->colspan = 100; } // show the table $note_table->show(); // creates a <div> around the content $quadro = new TElement('div'); $quadro->{'class'} = 'tnotebook_quadro'; $width = $this->width - 7; $quadro->style = "height:{$this->height}px;width:{$width}px"; if ($this->counter == 1) { self::$subNotes = $this->_getSubNotes(); } $i = 0; // iterate the tabs again, now to show the content if ($this->pages) { foreach ($this->pages as $title => $content) { // verify if the current page is to be shown if ($i == $this->currentPage and ($this->counter == 1 or in_array($this->id, self::$subNotes))) { $classe = 'tnotebook_painel_sim'; } else { $classe = 'tnotebook_painel_nao'; } // creates a <div> for the contents $painel = new TElement('div'); $painel->{'class'} = $classe; // CSS $painel->id = "painel_{$id}_{$i}"; // ID $quadro->add($painel); // check if the content is an object if (is_object($content)) { $painel->add($content); } $i++; } } $quadro_table = new TTable(); $quadro_table->width = $this->width; $quadro_table->{'class'} = 'tnotebook_table'; $quadro_table->border = 0; $quadro_table->cellspacing = 0; $quadro_table->cellpadding = 0; $row = $quadro_table->addRow(); $row->addCell($quadro); $quadro_table->show(); }