예제 #1
0
 protected function CreateGrid()
 {
     $result = new Grid($this, $this->dataset, 'hometextGrid');
     if ($this->GetSecurityInfo()->HasDeleteGrant()) {
         $result->SetAllowDeleteSelected(false);
     } else {
         $result->SetAllowDeleteSelected(false);
     }
     ApplyCommonPageSettings($this, $result);
     $result->SetUseImagesForActions(false);
     $result->SetUseFixedHeader(false);
     $result->SetShowLineNumbers(false);
     $result->SetHighlightRowAtHover(true);
     $result->SetWidth('');
     $this->CreateGridSearchControl($result);
     $this->CreateGridAdvancedSearchControl($result);
     $this->AddOperationsColumns($result);
     $this->AddFieldColumns($result);
     $this->AddSingleRecordViewColumns($result);
     $this->AddEditColumns($result);
     $this->AddInsertColumns($result);
     $this->AddPrintColumns($result);
     $this->AddExportColumns($result);
     $this->SetShowPageList(true);
     $this->SetHidePageListByDefault(false);
     $this->SetExportToExcelAvailable(false);
     $this->SetExportToWordAvailable(false);
     $this->SetExportToXmlAvailable(false);
     $this->SetExportToCsvAvailable(false);
     $this->SetExportToPdfAvailable(false);
     $this->SetPrinterFriendlyAvailable(false);
     $this->SetSimpleSearchAvailable(false);
     $this->SetAdvancedSearchAvailable(false);
     $this->SetFilterRowAvailable(false);
     $this->SetVisualEffectsEnabled(false);
     $this->SetShowTopPageNavigator(false);
     $this->SetShowBottomPageNavigator(false);
     //
     // Http Handlers
     //
     //
     // View column for text field
     //
     $column = new TextViewColumn('text', 'Text', $this->dataset);
     $column->SetOrderable(true);
     /* <inline edit column> */
     //
     // Edit column for text field
     //
     $editor = new HtmlWysiwygEditor('text_edit');
     $editor->SetAllowColorControls(true);
     $editColumn = new CustomEditColumn('Text', 'text', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetEditOperationColumn($editColumn);
     /* </inline edit column> */
     /* <inline insert column> */
     //
     // Edit column for text field
     //
     $editor = new HtmlWysiwygEditor('text_edit');
     $editor->SetAllowColorControls(true);
     $editColumn = new CustomEditColumn('Text', 'text', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $column->SetInsertOperationColumn($editColumn);
     /* </inline insert column> */
     $column = new DivTagViewColumnDecorator($column);
     $column->Align = 'left';
     $handler = new ShowTextBlobHandler($this->dataset, $this, 'text_handler', $column);
     GetApplication()->RegisterHTTPHandler($handler);
     //
     // View column for text field
     //
     $column = new TextViewColumn('text', 'Text', $this->dataset);
     $column->SetOrderable(true);
     $column = new DivTagViewColumnDecorator($column);
     $column->Align = 'left';
     $handler = new ShowTextBlobHandler($this->dataset, $this, 'text_handler', $column);
     GetApplication()->RegisterHTTPHandler($handler);
     //
     // View column for id field
     //
     $column = new TextViewColumn('id', 'Id', $this->dataset);
     $column->SetOrderable(true);
     $handler = new ShowTextBlobHandler($this->dataset, $this, 'id_handler', $column);
     GetApplication()->RegisterHTTPHandler($handler);
     return $result;
 }
예제 #2
0
파일: metodologia.php 프로젝트: jsrxar/dto
 protected function AddInsertColumns(Grid $grid)
 {
     //
     // Edit column for no_metodologia field
     //
     $editor = new TextEdit('no_metodologia_edit');
     $editor->SetSize(100);
     $editor->SetMaxLength(100);
     $editColumn = new CustomEditColumn('Nombre', 'no_metodologia', $editor, $this->dataset);
     $validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
     $editor->GetValidatorCollection()->AddValidator($validator);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for ds_metodologia field
     //
     $editor = new HtmlWysiwygEditor('ds_metodologia_edit');
     $editor->SetAllowColorControls(true);
     $editColumn = new CustomEditColumn('Descripción Metodo', 'ds_metodologia', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     
     //
     // Edit column for id_origen field
     //
     $editor = new ComboBox('id_origen_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
     $lookupDataset = new TableDataset(
         new PgConnectionFactory(),
         GetConnectionOptions(),
         '"public"."sga_origen"');
     $field = new IntegerField('id_origen', null, null, true);
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, true);
     $field = new StringField('no_origen');
     $field->SetIsNotNull(true);
     $lookupDataset->AddField($field, false);
     $lookupDataset->setOrderByField('no_origen', GetOrderTypeAsSQL(otAscending));
     $editColumn = new LookUpEditColumn(
         'Origen', 
         'id_origen', 
         $editor, 
         $this->dataset, 'id_origen', 'no_origen', $lookupDataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddInsertColumn($editColumn);
     if ($this->GetSecurityInfo()->HasAddGrant())
     {
         $grid->SetShowAddButton(true);
         $grid->SetShowInlineAddButton(false);
     }
     else
     {
         $grid->SetShowInlineAddButton(false);
         $grid->SetShowAddButton(false);
     }
 }
예제 #3
0
 protected function AddEditColumns(Grid $grid)
 {
     //
     // Edit column for text field
     //
     $editor = new HtmlWysiwygEditor('text_edit');
     $editor->SetAllowColorControls(true);
     $editColumn = new CustomEditColumn('Page Content', 'text', $editor, $this->dataset);
     $editColumn->SetAllowSetToNull(true);
     $this->ApplyCommonColumnEditProperties($editColumn);
     $grid->AddEditColumn($editColumn);
 }