当前位置: 首页>>代码示例>>PHP>>正文


PHP TAction::setParameter方法代码示例

本文整理汇总了PHP中TAction::setParameter方法的典型用法代码示例。如果您正苦于以下问题:PHP TAction::setParameter方法的具体用法?PHP TAction::setParameter怎么用?PHP TAction::setParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TAction的用法示例。


在下文中一共展示了TAction::setParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     parent::__construct();
     // creates one datagrid
     $this->datagrid = new TDataGrid();
     // create the datagrid columns
     $code = new TDataGridColumn('code', 'Code', 'left', 50);
     $name = new TDataGridColumn('name', 'Name', 'left', 180);
     $address = new TDataGridColumn('address', 'Address', 'left', 140);
     $telephone = new TDataGridColumn('fone', 'Phone', 'center', 100);
     // add the columns to the datagrid
     $this->datagrid->addColumn($code);
     $this->datagrid->addColumn($name);
     $this->datagrid->addColumn($address);
     $this->datagrid->addColumn($telephone);
     $action1 = new TAction(array($this, 'onColumnAction'));
     $action1->setParameter('column', 'code');
     $code->setAction($action1);
     $action2 = new TAction(array($this, 'onColumnAction'));
     $action2->setParameter('column', 'name');
     $name->setAction($action2);
     // creates the datagrid model
     $this->datagrid->createModel();
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->datagrid);
     parent::add($vbox);
 }
开发者ID:jfrank1500,项目名称:curso_php,代码行数:29,代码来源:DatagridColumnActionsView.class.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     $this->form = new TForm();
     // creates one datagrid
     $this->datagrid = new TQuickGrid();
     $this->datagrid->disableDefaultClick();
     $this->form->add($this->datagrid);
     // creates the action button
     $button1 = new TButton('action1');
     // define the button action
     $action_button1 = new TAction(array($this, 'onUpdate'));
     $action_button1->setParameter('id', filter_input(INPUT_GET, 'id'));
     $button1->setAction($action_button1, 'Atualizar');
     $button1->setImage('fa:check-circle-o green');
     $this->form->addField($button1);
     // add the columns
     $this->datagrid->addQuickColumn('Tipo de Atividade', 'nome', 'left', 180);
     $this->datagrid->addQuickColumn('Ticket', 'ticket', 'left', 180);
     $this->datagrid->addQuickColumn('Sistema', 'sistema', 'left', 180);
     // creates the datagrid model
     $this->datagrid->createModel();
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add($button1);
     $vbox->add($this->form);
     parent::add($vbox);
 }
开发者ID:jhonleandres,项目名称:Atividades,代码行数:28,代码来源:TipoAtividadesVinculos.class.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     // instancia objeto DataGrid
     $this->datagrid = new TDataGrid();
     // instancia as colunas da DataGrid
     $codigo = new TDataGridColumn('id', 'Código', 'right', 50);
     $nome = new TDataGridColumn('nome', 'Nome', 'left', 180);
     $endereco = new TDataGridColumn('endereco', 'Endereço', 'left', 140);
     $qualifica = new TDataGridColumn('qualifica', 'Qualificações', 'left', 200);
     $action1 = new TAction(array($this, 'onReload'));
     $action1->setParameter('order', 'id');
     $action2 = new TAction(array($this, 'onReload'));
     $action2->setParameter('order', 'nome');
     $codigo->setAction($action1);
     $nome->setAction($action2);
     // adiciona as colunas à DataGrid
     $this->datagrid->addColumn($codigo);
     $this->datagrid->addColumn($nome);
     $this->datagrid->addColumn($endereco);
     $this->datagrid->addColumn($qualifica);
     // cria o modelo da DataGrid, montando sua estrutura
     $this->datagrid->createModel();
     // adiciona a DataGrid à página
     parent::add($this->datagrid);
 }
开发者ID:CodeBooks,项目名称:php-programando-com-orientacao-a-objetos,代码行数:26,代码来源:list5.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     // create two actions
     $action1 = new TAction(array($this, 'onAction1'));
     $action2 = new TAction(array($this, 'onAction2'));
     // define os parâmetros de cada ação
     $action1->setParameter('parameter', 1);
     $action2->setParameter('parameter', 2);
     // shows the question dialog
     new TQuestion('Do you really want to perform this operation ?', $action1, $action2);
     parent::add(new TXMLBreadCrumb('menu.xml', __CLASS__));
 }
开发者ID:jfrank1500,项目名称:curso_php,代码行数:13,代码来源:DialogQuestionView.class.php

示例5: addQuickColumn

 /**
  * Add a column
  * @param $label  Field Label
  * @param $object Field Object
  * @param $size   Field Size
  */
 public function addQuickColumn($label, $name, $align = 'left', $size = 200, TAction $action = NULL, $param = NULL)
 {
     // creates a new column
     $object = new TDataGridColumn($name, $label, $align, $size);
     if ($action instanceof TAction) {
         // create ordering
         $action->setParameter($param[0], $param[1]);
         $object->setAction($action);
     }
     // add the column to the datagrid
     parent::addColumn($object);
     return $object;
 }
开发者ID:enieber,项目名称:adianti,代码行数:19,代码来源:TQuickGrid.class.php

示例6: __construct

 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     new TSession();
     // creates a DataGrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->setHeight(280);
     // creates the datagrid columns
     $id = new TDataGridColumn('id', 'id', 'right', 40);
     $name = new TDataGridColumn('name', 'Name', 'left', 200);
     $address = new TDataGridColumn('address', 'Address', 'left', 200);
     // creates the datagrid actions
     $order1 = new TAction(array($this, 'onReload'));
     $order2 = new TAction(array($this, 'onReload'));
     // define the ordering parameters
     $order1->setParameter('order', 'id');
     $order2->setParameter('order', 'name');
     // assign the ordering actions
     $id->setAction($order1);
     $name->setAction($order2);
     // add the columns to the DataGrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($name);
     $this->datagrid->addColumn($address);
     // creates a datagrid action
     $action1 = new TDataGridAction(array('CustomerFormView', 'onEdit'));
     $action1->setLabel('Edit');
     $action1->setImage('ico_edit.png');
     $action1->setField('id');
     // add the actions to the datagrid
     $this->datagrid->addAction($action1);
     // creates the edit action
     $editaction = new TDataGridAction(array($this, 'onEdit'));
     $editaction->setField('id');
     $name->setEditAction($editaction);
     // create the datagrid model
     $this->datagrid->createModel();
     // creates the page navigation
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // creates the page structure using a table
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->datagrid);
     $vbox->add($this->pageNavigation);
     // add the table inside the page
     parent::add($vbox);
 }
开发者ID:jfrank1500,项目名称:curso_php,代码行数:53,代码来源:InlineDataGridView.class.php

示例7: TQuickForm

 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     parent::setDatabase('esales');
     // defines the database
     parent::setActiveRecord('Pessoa');
     // defines the active record
     // creates the form
     $this->form = new TQuickForm('form_Pessoa');
     $this->form->class = 'tform';
     // CSS class
     $this->form->style = 'width: 500px';
     // define the form title
     $this->form->setFormTitle('Pessoa');
     // create the form fields
     $id = new TEntry('id');
     $nome = new TEntry('nome');
     $telefone = new TEntry('telefone');
     $email = new TEntry('email');
     $endereco = new TEntry('endereco');
     $numero = new TEntry('numero');
     $cidade_id = new TSeekButton('cidade_id');
     $cidade_id->addValidation('Cidade', new TRequiredValidator());
     $cidade_name = new TEntry('cidade_name');
     $obj = new TStandardSeek();
     $action = new TAction(array($obj, 'onSetup'));
     $action->setParameter('database', 'esales');
     $action->setParameter('parent', 'form_Pessoa');
     $action->setParameter('model', 'Cidade');
     $action->setParameter('display_field', 'descricao');
     $action->setParameter('receive_key', 'cidade_id');
     $action->setParameter('receive_field', 'cidade_name');
     $cidade_id->setAction($action);
     $cep = new TEntry('cep');
     $cpf_cnpj = new TEntry('cpf_cnpj');
     $tipo_pessoa = new TRadioGroup('tipo_pessoa');
     $tipo_pessoa->addItems(array('F' => 'Fisica', 'J' => 'Juridica'));
     // add the fields
     $this->form->addQuickField('Codigo', $id, 100);
     $this->form->addQuickField('Nome', $nome, 200);
     $this->form->addQuickField('Telefone', $telefone, 200);
     $this->form->addQuickField('Email', $email, 200);
     $this->form->addQuickField('Endereço', $endereco, 200);
     $this->form->addQuickField('Numero', $numero, 200);
     $this->form->addQuickFields('Cidade', array($cidade_id, $cidade_name), true);
     $this->form->addQuickField('CEP', $cep, 200);
     $this->form->addQuickField('CPF/CNPJ', $cpf_cnpj, 100);
     $this->form->addQuickField('Tipo de pessoa', $tipo_pessoa, 200);
     // create the form actions
     $this->form->addQuickAction('Salvar', new TAction(array($this, 'onSave')), 'ico_save.png');
     $this->form->addQuickAction('Novo', new TAction(array($this, 'onEdit')), 'ico_new.png');
     // add the form to the page
     parent::add($this->form);
 }
开发者ID:klausetgeton,项目名称:esales-gtk,代码行数:58,代码来源:PessoaForm.class.php

示例8: __construct

 /**
  * Class Constructor
  * @param  $name name of the form field
  * @param  $database name of the database connection
  * @param  $form name of the parent form
  * @param  $model name of the Active Record to be searched
  * @param  $display_field name of the field to be searched and shown
  * @param  $receive_key name of the form field to receive the primary key
  * @param  $receive_display_field name of the form field to receive the "display field"
  */
 public function __construct($name, $database, $form, $model, $display_field, $receive_key, $receive_display_field)
 {
     parent::__construct($name);
     $obj = new TStandardSeek();
     // define the action parameters
     $action = new TAction(array($obj, 'onSetup'));
     $action->setParameter('database', $database);
     $action->setParameter('parent', $form);
     $action->setParameter('model', $model);
     $action->setParameter('display_field', $display_field);
     $action->setParameter('receive_key', $receive_key);
     $action->setParameter('receive_field', $receive_display_field);
     parent::setAction($action);
 }
开发者ID:jhonleandres,项目名称:pecommerce,代码行数:24,代码来源:TDBSeekButton.class.php

示例9: TQuickForm

 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     parent::setDatabase('esales');
     // defines the database
     parent::setActiveRecord('Produto');
     // defines the active record
     // creates the form
     $this->form = new TQuickForm('form_Produto');
     $this->form->class = 'tform';
     // CSS class
     $this->form->style = 'width: 500px';
     // define the form title
     $this->form->setFormTitle('Produto');
     // create the form fields
     $id = new TEntry('id');
     $descricao = new TEntry('descricao');
     $preco_compra = new TEntry('preco_compra');
     $preco_venda = new TEntry('preco_venda');
     $marca_id = new TEntry('marca_id');
     $marca_id = new TSeekButton('marca_id');
     $marca_name = new TEntry('marca_name');
     $obj = new TStandardSeek();
     $action = new TAction(array($obj, 'onSetup'));
     $action->setParameter('database', 'esales');
     $action->setParameter('parent', 'form_Produto');
     $action->setParameter('model', 'Marca');
     $action->setParameter('display_field', 'descricao');
     $action->setParameter('receive_key', 'marca_id');
     $action->setParameter('receive_field', 'marca_name');
     $marca_id->setAction($action);
     // add the fields
     $this->form->addQuickField('Codigo', $id, 100);
     $this->form->addQuickField('Descricao', $descricao, 200);
     $this->form->addQuickField('Preco compra', $preco_compra, 200);
     $this->form->addQuickField('Preco venda', $preco_venda, 200);
     $this->form->addQuickFields('Marca', array($marca_id, $marca_name));
     // create the form actions
     $this->form->addQuickAction('Salvar', new TAction(array($this, 'onSave')), 'ico_save.png');
     $this->form->addQuickAction('Novo', new TAction(array($this, 'onEdit')), 'ico_new.png');
     // add the form to the page
     parent::add($this->form);
 }
开发者ID:klausetgeton,项目名称:esales-gtk,代码行数:47,代码来源:ProdutoForm.class.php

示例10: show

 /**
  * Show the widget
  */
 public function show()
 {
     // check if it's not editable
     if (parent::getEditable()) {
         $serialized_action = '';
         if ($this->action) {
             // get the action class name
             if (is_array($callback = $this->action->getAction())) {
                 $classname = get_class($callback[0]);
                 $inst = new $classname();
                 $ajaxAction = new TAction(array($inst, 'onSelect'));
                 if ($classname == 'TStandardSeek') {
                     $ajaxAction->setParameter('parent', $this->action->getParameter('parent'));
                     $ajaxAction->setParameter('database', $this->action->getParameter('database'));
                     $ajaxAction->setParameter('model', $this->action->getParameter('model'));
                     $ajaxAction->setParameter('display_field', $this->action->getParameter('display_field'));
                     $ajaxAction->setParameter('receive_key', $this->action->getParameter('receive_key'));
                     $ajaxAction->setParameter('receive_field', $this->action->getParameter('receive_field'));
                 }
                 $string_action = $ajaxAction->serialize(FALSE);
                 if ($this->useOutEvent) {
                     $this->setProperty('onBlur', "serialform=(\$('#{$this->formName}').serialize());\n                                                      ajaxLookup('{$string_action}&'+serialform, this)");
                 }
             }
             $serialized_action = $this->action->serialize(FALSE);
         }
         parent::show();
         $image = new TImage('lib/adianti/images/ico_find.png');
         $link = new TElement('a');
         $link->onmouseover = 'style.cursor = \'pointer\'';
         $link->onmouseout = 'style.cursor = \'default\'';
         $link->onclick = "javascript:serialform=(\$('#{$this->formName}').serialize());\n                  __adianti_append_page('engine.php?{$serialized_action}&'+serialform)";
         $link->add($image);
         $link->show();
         if ($this->auxiliar) {
             echo ' ';
             $this->auxiliar->show();
         }
     } else {
         parent::show();
     }
 }
开发者ID:enieber,项目名称:adianti,代码行数:45,代码来源:TSeekButton.class.php

示例11: onDelete

 /**
  * method onDelete()
  * executed whenever the user clicks at the delete button
  * Ask if the user really wants to delete the record
  */
 function onDelete($param)
 {
     // get the parameter $key
     $key = $param['key'];
     // define two actions
     $action = new TAction(array($this, 'Delete'));
     // define the action parameters
     $action->setParameter('key', $key);
     // shows a dialog to the user
     new TQuestion(TAdiantiCoreTranslator::translate('Do you really want to delete ?'), $action);
 }
开发者ID:enieber,项目名称:adianti,代码行数:16,代码来源:TStandardFormList.class.php

示例12: onReload

 /**
  * Recarrega tela
  */
 public function onReload($param)
 {
     $dados = TSession::getValue('person_dados');
     $this->lista->clear();
     if ($dados) {
         foreach ($dados as $dado) {
             $item_name = 'check_' . $dado[0];
             $item = new StdClass();
             $action_del = new TAction(array($this, 'onDeleteItem'));
             $action_del->setParameter('item', $dado[0]);
             $action_edi = new TAction(array($this, 'onEditItem'));
             $action_edi->setParameter('item', $dado[0]);
             $button_del = new TButton('delete_' . $dado[0]);
             $button_del->class = 'btn btn-default btn-sm';
             $button_del->setAction($action_del, '');
             $button_del->setImage('fa:trash-o');
             $button_edi = new TButton('edit_' . $dado[0]);
             $button_edi->class = 'btn btn-default btn-sm';
             $button_edi->setAction($action_edi, '');
             $button_edi->setImage('fa:edit');
             $item->edit = $button_edi;
             $item->delete = $button_del;
             $this->formFields[$item_name . '_edit'] = $item->edit;
             $this->formFields[$item_name . '_delete'] = $item->delete;
             $item->code = $dado[0];
             $item->description = $dado[1];
             $item->value = $dado[2];
             $this->lista->addItem($item);
         }
         $this->form->setFields($this->formFields);
     }
     $this->loaded = TRUE;
 }
开发者ID:jfrank1500,项目名称:curso_php,代码行数:36,代码来源:PersonForm.class.php

示例13: __construct

 /**
  * Class constructor
  * Creates the page, the search form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     new TSession();
     // creates the form
     $this->form = new TForm('form_listar_crm_clientes');
     $key = $_GET['key'];
     // create the form fields
     $name = new TEntry('nome');
     $name->setSize(170);
     $table = new TTable();
     $row = $table->addRow();
     $cell = $row->addCell('');
     $cell->width = PHP_SAPI == 'cli' ? 40 : 80;
     $row->addCell($name);
     $this->form->add($table);
     // creates the action button
     $button1 = new TButton('find');
     $button1->setAction(new TAction(array($this, 'onSearch')), 'Buscar');
     $button1->setImage('ico_find.png');
     // create an action button
     $button2 = new TButton('novo');
     $action2 = new TAction(array('CRMForm', 'onEdit'));
     $action2->setParameter('key', $key);
     $button2->setImage('ico_new.png');
     $button2->setAction($action2, 'Novo');
     $button3 = new TButton('csv');
     $button3->setAction(new TAction(array($this, 'onExportCSV')), 'CSV');
     $button3->setImage('ico_print.png');
     // create an action button
     $button4 = new TButton('action3');
     $action4 = new TAction(array('ClienteList', 'onReload'));
     //        $action3->setParameter('key', $_GET['key']);
     $action4->setParameter('key', $key);
     $button4->setImage('ico_previous.png');
     $button4->setAction($action4, 'Voltar');
     $row->addCell($button1);
     $row->addCell($button2);
     $row->addCell($button3);
     $row->addCell($button4);
     $this->form->setFields(array($name, $button1, $button2, $button3, $button4));
     // creates a DataGrid
     $this->datagrid = new TDataGrid();
     //        $this->datagrid->setHeight(200);
     // create the datagrid columns
     $dgid = new TDataGridColumn('id', 'Id', 'right', 70);
     $dgtitulo = new TDataGridColumn('titulo', 'Titulo', 'left', 180);
     $dgprojeto = new TDataGridColumn('projeto_nome', 'Projeto', 'left', 180);
     $dgdata = new TDataGridColumn('data_crm', 'Data', 'left', 160);
     $dgtempo = new TDataGridColumn('tempo', 'Tempo', 'left', 160);
     $dgdescricao = new TDataGridColumn('descricao', 'Descrição', 'left', 160);
     $dgsolicitante = new TDataGridColumn('solicitante', 'Solicitante', 'left', 160);
     $dgresponsavel = new TDataGridColumn('tipo_nome', 'Tipo', 'left', 160);
     $dgcliente = new TDataGridColumn('cliente_nome', 'Cliente', 'left', 160);
     $dgnome = new TDataGridColumn('prioridade_nome', 'Prioridade', 'left', 160);
     $dgstatus = new TDataGridColumn('status_nome', 'Status', 'left', 160);
     // add the columns to the datagrid
     $this->datagrid->addColumn($dgid);
     $this->datagrid->addColumn($dgtitulo);
     $this->datagrid->addColumn($dgprojeto);
     $this->datagrid->addColumn($dgdata);
     $this->datagrid->addColumn($dgtempo);
     $this->datagrid->addColumn($dgdescricao);
     $this->datagrid->addColumn($dgsolicitante);
     $this->datagrid->addColumn($dgresponsavel);
     $this->datagrid->addColumn($dgcliente);
     $this->datagrid->addColumn($dgnome);
     $this->datagrid->addColumn($dgstatus);
     // creates two datagrid actions
     $action1 = new TDataGridAction(array('CRMForm', 'onEdit'));
     $action1->setLabel('Editar');
     $action1->setImage('ico_edit.png');
     $action1->setField('id');
     $action2 = new TDataGridAction(array($this, 'onDelete'));
     $action2->setLabel('Delete');
     $action2->setImage('ico_delete.png');
     $action2->setField('id');
     //        $obj = ClienteRegistroDetalhe();
     $action3 = new TDataGridAction(array('ClienteRegistroDetalhe', 'onEdit'));
     $action3->setLabel('Registros');
     $action3->setImage('ico_custom_form.png');
     $action3->setField('id');
     $action3->setParameter('fk', $_GET['key']);
     // add the actions to the datagrid
     $this->datagrid->addAction($action1);
     $this->datagrid->addAction($action2);
     $this->datagrid->addAction($action3);
     // create the datagrid model
     $this->datagrid->createModel();
     // creates the page navigation
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // creates the page structure using a table
     $table = new TTable();
     $table->addRow()->addCell($this->form);
//.........这里部分代码省略.........
开发者ID:jhonleandres,项目名称:crmbf,代码行数:101,代码来源:CRMClienteList.class.php

示例14: __construct

 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_search_System_user');
     $this->form->class = 'tform';
     // creates a table
     $table = new TTable();
     $table->style = 'width:100%';
     $table->addRowSet(new TLabel(_t('Users')), '')->class = 'tformtitle';
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $id = new TEntry('id');
     $id->setValue(TSession::getValue('System_user_id'));
     $name = new TEntry('name');
     $name->setValue(TSession::getValue('System_user_name'));
     // add a row for the filter field
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel(_t('Name') . ': '), $name);
     // create two action buttons to the form
     $find_button = new TButton('find');
     $new_button = new TButton('new');
     // define the button actions
     $find_button->setAction(new TAction(array($this, 'onSearch')), _t('Find'));
     $find_button->setImage('fa:search');
     $new_button->setAction(new TAction(array('SystemUserForm', 'onEdit')), _t('New'));
     $new_button->setImage('fa:plus-square green');
     // add a row for the form actions
     $container = new THBox();
     $container->add($find_button);
     $container->add($new_button);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($container);
     $cell->colspan = 2;
     // define wich are the form fields
     $this->form->setFields(array($id, $name, $find_button, $new_button));
     // creates a DataGrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->setHeight(320);
     $this->datagrid->style = 'width: 100%';
     // creates the datagrid columns
     $id = new TDataGridColumn('id', 'ID', 'center');
     $name = new TDataGridColumn('name', _t('Name'), 'center');
     $login = new TDataGridColumn('login', _t('Login'), 'center');
     $email = new TDataGridColumn('email', _t('Email'), 'center');
     // add the columns to the DataGrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($name);
     $this->datagrid->addColumn($login);
     $this->datagrid->addColumn($email);
     // creates the datagrid column actions
     $order_id = new TAction(array($this, 'onReload'));
     $order_id->setParameter('order', 'id');
     $id->setAction($order_id);
     $order_name = new TAction(array($this, 'onReload'));
     $order_name->setParameter('order', 'name');
     $name->setAction($order_name);
     $order_login = new TAction(array($this, 'onReload'));
     $order_login->setParameter('order', 'login');
     $login->setAction($order_login);
     $order_email = new TAction(array($this, 'onReload'));
     $order_email->setParameter('order', 'email');
     $email->setAction($order_email);
     // inline editing
     $name_edit = new TDataGridAction(array($this, 'onInlineEdit'));
     $name_edit->setField('id');
     $name->setEditAction($name_edit);
     // creates two datagrid actions
     $action1 = new TDataGridAction(array('SystemUserForm', 'onEdit'));
     $action1->setLabel(_t('Edit'));
     $action1->setImage('fa:pencil-square-o blue fa-lg');
     $action1->setField('id');
     $action2 = new TDataGridAction(array($this, 'onDelete'));
     $action2->setLabel(_t('Delete'));
     $action2->setImage('fa:trash-o grey fa-lg');
     $action2->setField('id');
     // add the actions to the datagrid
     $this->datagrid->addAction($action1);
     $this->datagrid->addAction($action2);
     // create the datagrid model
     $this->datagrid->createModel();
     // creates the page navigation
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // creates the page structure using a table
     $table = new TTable();
     $table->style = 'width: 80%';
     $table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $table->addRow()->addCell($this->form);
     $table->addRow()->addCell($this->datagrid);
     $table->addRow()->addCell($this->pageNavigation);
     // add the table inside the page
     parent::add($table);
//.........这里部分代码省略.........
开发者ID:kiibe,项目名称:linkERP,代码行数:101,代码来源:SystemUserList.class.php

示例15: __construct

 /**
  * Class constructor
  * Creates the page, the form and the listing
  */
 public function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_search_SystemProgram');
     $this->form->class = 'tform';
     // creates a table
     $table = new TTable();
     $table->style = 'width:100%';
     $table->addRowSet(new TLabel(_t('Programs')), '')->class = 'tformtitle';
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $name = new TEntry('name');
     $name->setValue(TSession::getValue('SystemProgram_name'));
     $control = new TEntry('controller');
     $control->setValue(TSession::getValue('SystemProgram_control'));
     // add rows for the filter fields
     $row = $table->addRowSet(new TLabel(_t('Name') . ': '), $name);
     $row = $table->addRowSet(new TLabel(_t('Controller') . ': '), $control);
     // create two action buttons to the form
     $find_button = new TButton('find');
     $new_button = new TButton('new');
     // define the button actions
     $find_button->setAction(new TAction(array($this, 'onSearch')), _t('Find'));
     $find_button->setImage('ico_find.png');
     $new_button->setAction(new TAction(array('SystemProgramForm', 'onEdit')), _t('New'));
     $new_button->setImage('ico_new.png');
     // define wich are the form fields
     $this->form->setFields(array($name, $control, $find_button, $new_button));
     $container = new THBox();
     $container->add($find_button);
     $container->add($new_button);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($container);
     $cell->colspan = 2;
     // creates a DataGrid
     $this->datagrid = new TDataGrid();
     $this->datagrid->style = 'width: 100%';
     $this->datagrid->setHeight(320);
     // creates the datagrid columns
     $id = new TDataGridColumn('id', 'ID', 'right');
     $name = new TDataGridColumn('name', _t('Name'), 'left');
     $controller = new TDataGridColumn('controller', _t('Controller'), 'left');
     // add the columns to the DataGrid
     $this->datagrid->addColumn($id);
     $this->datagrid->addColumn($name);
     $this->datagrid->addColumn($controller);
     // creates the datagrid column actions
     $order_id = new TAction(array($this, 'onReload'));
     $order_id->setParameter('order', 'id');
     $id->setAction($order_id);
     $order_name = new TAction(array($this, 'onReload'));
     $order_name->setParameter('order', 'name');
     $name->setAction($order_name);
     $order_controller = new TAction(array($this, 'onReload'));
     $order_controller->setParameter('order', 'controller');
     $controller->setAction($order_controller);
     // inline editing
     $name_edit = new TDataGridAction(array($this, 'onInlineEdit'));
     $name_edit->setField('id');
     $name->setEditAction($name_edit);
     $controller_edit = new TDataGridAction(array($this, 'onInlineEdit'));
     $controller_edit->setField('id');
     $controller->setEditAction($controller_edit);
     // creates two datagrid actions
     $action1 = new TDataGridAction(array('SystemProgramForm', 'onEdit'));
     $action1->setLabel(_t('Edit'));
     $action1->setImage('ico_edit.png');
     $action1->setField('id');
     $action2 = new TDataGridAction(array($this, 'onDelete'));
     $action2->setLabel(_t('Delete'));
     $action2->setImage('ico_delete.png');
     $action2->setField('id');
     // add the actions to the datagrid
     $this->datagrid->addAction($action1);
     $this->datagrid->addAction($action2);
     // create the datagrid model
     $this->datagrid->createModel();
     // creates the page navigation
     $this->pageNavigation = new TPageNavigation();
     $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
     $this->pageNavigation->setWidth($this->datagrid->getWidth());
     // creates the page structure using a table
     $table = new TTable();
     $table->style = 'width: 80%';
     $table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $table->addRow()->addCell($this->form);
     $table->addRow()->addCell($this->datagrid);
     $table->addRow()->addCell($this->pageNavigation);
     // add the table inside the page
     parent::add($table);
 }
开发者ID:eduardojsouza,项目名称:liger,代码行数:98,代码来源:SystemProgramList.class.php


注:本文中的TAction::setParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。