本文整理汇总了PHP中TextEdit::GetValidatorCollection方法的典型用法代码示例。如果您正苦于以下问题:PHP TextEdit::GetValidatorCollection方法的具体用法?PHP TextEdit::GetValidatorCollection怎么用?PHP TextEdit::GetValidatorCollection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextEdit
的用法示例。
在下文中一共展示了TextEdit::GetValidatorCollection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for election_div_id field
//
$editor = new MultiLevelComboBoxEditor('election_div_id_edit', $this->CreateLinkBuilder());
$dataset0 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."state"');
$field = new StringField('abbr');
$field->SetIsNotNull(true);
$dataset0->AddField($field, true);
$field = new StringField('name');
$dataset0->AddField($field, false);
$editor->AddLevel($dataset0, 'abbr', 'name', $this->RenderText('State'), null);
$dataset1 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."election_div"');
$field = new IntegerField('id');
$field->SetIsNotNull(true);
$dataset1->AddField($field, true);
$field = new StringField('name');
$field->SetIsNotNull(true);
$dataset1->AddField($field, false);
$field = new StringField('phys_addr_addr1');
$dataset1->AddField($field, false);
$field = new StringField('phys_addr_addr2');
$dataset1->AddField($field, false);
$field = new StringField('phys_addr_city');
$dataset1->AddField($field, false);
$field = new StringField('phys_addr_state');
$dataset1->AddField($field, false);
$field = new StringField('phys_addr_zip');
$dataset1->AddField($field, false);
$field = new StringField('mail_addr_addr1');
$dataset1->AddField($field, false);
$field = new StringField('mail_addr_addr2');
$dataset1->AddField($field, false);
$field = new StringField('mail_addr_city');
$dataset1->AddField($field, false);
$field = new StringField('mail_addr_state');
$dataset1->AddField($field, false);
$field = new StringField('mail_addr_zip');
$dataset1->AddField($field, false);
$field = new StringField('phone');
$dataset1->AddField($field, false);
$field = new StringField('fax');
$dataset1->AddField($field, false);
$field = new StringField('website');
$dataset1->AddField($field, false);
$field = new StringField('notes');
$dataset1->AddField($field, false);
$dataset1->SetOrderBy('name', GetOrderTypeAsSQL(otAscending));
$editor->AddLevel($dataset1, 'id', 'name', $this->RenderText('Election Division'), new ForeignKeyInfo('abbr', 'phys_addr_state'));
$editColumn = new MultiLevelLookupEditColumn('Election Division', 'election_div_id', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for name field
//
$editor = new TextEdit('name_edit');
$editor->SetSize(35);
$editor->SetMaxLength(35);
$editColumn = new CustomEditColumn('Document Name or Description', 'name', $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 link field
//
$editor = new TextAreaEdit('link_edit', 50, 8);
$editColumn = new CustomEditColumn('URL to Document', 'link', $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);
if ($this->GetSecurityInfo()->HasAddGrant()) {
$grid->SetShowAddButton(true);
$grid->SetShowInlineAddButton(false);
} else {
$grid->SetShowInlineAddButton(false);
$grid->SetShowAddButton(false);
}
}
示例2: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for no_tipo_espacio field
//
$editor = new TextEdit('no_tipo_espacio_edit');
$editor->SetSize(100);
$editor->SetMaxLength(100);
$editColumn = new CustomEditColumn('No Tipo Espacio', 'no_tipo_espacio', $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 id_tipo_espacio_padre field
//
$editor = new ComboBox('id_tipo_espacio_padre_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(
new PgConnectionFactory(),
GetConnectionOptions(),
'"public"."sga_tipo_espacio"');
$field = new IntegerField('id_tipo_espacio', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('no_tipo_espacio');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('id_tipo_espacio_padre');
$lookupDataset->AddField($field, false);
$field = new StringField('ds_referencia');
$lookupDataset->AddField($field, false);
$lookupDataset->setOrderByField('no_tipo_espacio', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn(
'Id Tipo Espacio Padre',
'id_tipo_espacio_padre',
$editor,
$this->dataset, 'id_tipo_espacio', 'no_tipo_espacio', $lookupDataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for ds_referencia field
//
$editor = new TextAreaEdit('ds_referencia_edit', 50, 8);
$editColumn = new CustomEditColumn('Ds Referencia', 'ds_referencia', $editor, $this->dataset);
$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: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for USERNAME field
//
$editor = new TextEdit('username_edit');
$editor->SetSize(10);
$editor->SetMaxLength(10);
$editColumn = new CustomEditColumn('USERNAME', 'USERNAME', $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 ES_ADMIN field
//
$editor = new TextEdit('es_admin_edit');
$editor->SetSize(1);
$editor->SetMaxLength(1);
$editColumn = new CustomEditColumn('ES ADMIN', 'ES_ADMIN', $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 NACIMIENTO field
//
$editor = new DateTimeEdit('nacimiento_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('NACIMIENTO', 'NACIMIENTO', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for PRIMER_APELLIDO field
//
$editor = new TextEdit('primer_apellido_edit');
$editor->SetSize(30);
$editor->SetMaxLength(30);
$editColumn = new CustomEditColumn('PRIMER APELLIDO', 'PRIMER_APELLIDO', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for SEGUNDO_APELLIDO field
//
$editor = new TextEdit('segundo_apellido_edit');
$editor->SetSize(50);
$editor->SetMaxLength(50);
$editColumn = new CustomEditColumn('SEGUNDO APELLIDO', 'SEGUNDO_APELLIDO', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for NOMBRE field
//
$editor = new TextEdit('nombre_edit');
$editor->SetSize(40);
$editor->SetMaxLength(40);
$editColumn = new CustomEditColumn('NOMBRE', 'NOMBRE', $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 GENERO_ID field
//
$editor = new ComboBox('genero_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."GENERO"');
$field = new IntegerField('GENERO_ID');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('NOMBRE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new DateField('FEC_CREACION');
$lookupDataset->AddField($field, false);
$field = new StringField('USUARIO_CREACION');
$lookupDataset->AddField($field, false);
$field = new DateField('FEC_ULTIMA_MOD');
$lookupDataset->AddField($field, false);
$field = new StringField('USUARIO_ULTIMA_MOD');
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('NOMBRE', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('GENERO ID', 'GENERO_ID', $editor, $this->dataset, 'GENERO_ID', 'NOMBRE', $lookupDataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for CIUDAD_ID field
//
$editor = new ComboBox('ciudad_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."CIUDAD"');
$field = new IntegerField('CIUDAD_ID');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('NOMBRE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('PAIS_ID');
$lookupDataset->AddField($field, false);
//.........这里部分代码省略.........
示例4: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for ESTADO_CIVIL_ID field
//
$editor = new TextEdit('estado_civil_id_edit');
$editColumn = new CustomEditColumn('ESTADO CIVIL ID', 'ESTADO_CIVIL_ID', $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 NOMBRE field
//
$editor = new TextEdit('nombre_edit');
$editor->SetSize(20);
$editor->SetMaxLength(20);
$editColumn = new CustomEditColumn('NOMBRE', 'NOMBRE', $editor, $this->dataset);
$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);
}
}
示例5: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for project_name field
//
$editor = new TextEdit('project_name_edit');
$editColumn = new CustomEditColumn('Project Name', 'project_name', $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 approved_budget field
//
$editor = new TextEdit('approved_budget_edit');
$editColumn = new CustomEditColumn('Approved Budget', 'approved_budget', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$validator = new NumberValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('NumberValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for lead field
//
$editor = new TextEdit('lead_edit');
$editColumn = new CustomEditColumn('Lead', 'lead', $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);
if ($this->GetSecurityInfo()->HasAddGrant()) {
$grid->SetShowAddButton(false);
$grid->SetShowInlineAddButton(false);
} else {
$grid->SetShowInlineAddButton(false);
$grid->SetShowAddButton(false);
}
}
示例6: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for EVENTO_ID field
//
$editor = new TextEdit('evento_id_edit');
$editColumn = new CustomEditColumn('EVENTO ID', 'EVENTO_ID', $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 NOMBRE field
//
$editor = new TextEdit('nombre_edit');
$editor->SetSize(30);
$editor->SetMaxLength(30);
$editColumn = new CustomEditColumn('NOMBRE', 'NOMBRE', $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 FECHA_HORA field
//
$editor = new DateTimeEdit('fecha_hora_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('FECHA HORA', 'FECHA_HORA', $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 LUGAR field
//
$editor = new TextEdit('lugar_edit');
$editor->SetSize(30);
$editor->SetMaxLength(30);
$editColumn = new CustomEditColumn('LUGAR', 'LUGAR', $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 DESCRIPCION field
//
$editor = new TextAreaEdit('descripcion_edit', 50, 8);
$editColumn = new CustomEditColumn('DESCRIPCION', 'DESCRIPCION', $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 CIUDAD field
//
$editor = new ComboBox('ciudad_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."CIUDAD"');
$field = new IntegerField('CIUDAD_ID');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('NOMBRE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('PAIS_ID');
$lookupDataset->AddField($field, false);
$field = new DateField('FEC_CREACION');
$lookupDataset->AddField($field, false);
$field = new StringField('USUARIO_CREACION');
$lookupDataset->AddField($field, false);
$field = new DateField('FEC_ULTIMA_MOD');
$lookupDataset->AddField($field, false);
$field = new StringField('USUARIO_ULTIMA_MOD');
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('NOMBRE', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('CIUDAD', 'CIUDAD', $editor, $this->dataset, 'CIUDAD_ID', 'NOMBRE', $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);
}
}
示例7: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for first_name field
//
$editor = new TextEdit('first_name_edit');
$editor->SetSize(25);
$editor->SetMaxLength(25);
$editColumn = new CustomEditColumn('First Name', 'first_name', $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 middle_name field
//
$editor = new TextEdit('middle_name_edit');
$editor->SetSize(25);
$editor->SetMaxLength(25);
$editColumn = new CustomEditColumn('Middle Name', 'middle_name', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for last_name field
//
$editor = new TextEdit('last_name_edit');
$editor->SetSize(25);
$editor->SetMaxLength(25);
$editColumn = new CustomEditColumn('Last Name', 'last_name', $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 party_affiliation field
//
$editor = new TextEdit('party_affiliation_edit');
$editor->SetSize(1);
$editor->SetMaxLength(1);
$editColumn = new CustomEditColumn('Party Affiliation', 'party_affiliation', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for address1 field
//
$editor = new TextEdit('address1_edit');
$editor->SetSize(25);
$editor->SetMaxLength(25);
$editColumn = new CustomEditColumn('Address1', 'address1', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for address2 field
//
$editor = new TextEdit('address2_edit');
$editor->SetSize(25);
$editor->SetMaxLength(25);
$editColumn = new CustomEditColumn('Address2', 'address2', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for city field
//
$editor = new TextEdit('city_edit');
$editor->SetSize(25);
$editor->SetMaxLength(25);
$editColumn = new CustomEditColumn('City', 'city', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for state field
//
$editor = new TextEdit('state_edit');
$editor->SetSize(2);
$editor->SetMaxLength(2);
$editColumn = new CustomEditColumn('State', 'state', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for zip field
//
$editor = new TextEdit('zip_edit');
$editor->SetSize(5);
$editor->SetMaxLength(5);
$editColumn = new CustomEditColumn('Zip', 'zip', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for phone field
//
$editor = new TextEdit('phone_edit');
$editor->SetSize(15);
$editor->SetMaxLength(15);
//.........这里部分代码省略.........
示例8: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for programm_id field
//
$editor = new ComboBox('programm_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$editColumn = new CustomEditColumn('Project Type', 'programm_id', $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 project_name field
//
$editor = new TextEdit('project_name_edit');
$editColumn = new CustomEditColumn('Project Name', 'project_name', $editor, $this->dataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$validator = new CustomRegExpValidator('^[A-Za-z0-9 ()&]+[-]*[A-Za-z0-9 ()&]*$', StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RegExpValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for date_start field
//
$editor = new DateTimeEdit('date_start_edit', false, 'Y-m-d', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Date Start', 'date_start', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
$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 date_end field
//
$editor = new DateTimeEdit('date_end_edit', true, 'Y-m-d', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
$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 year field
//
$editor = new TextEdit('year_edit');
$editColumn = new CustomEditColumn('Year', 'year', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('2016'));
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$validator = new NumberValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('NumberValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for notes field
//
$editor = new TextAreaEdit('notes_edit', 50, 8);
$editColumn = new CustomEditColumn('Objectives', 'notes', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for priority field
//
$editor = new ComboBox('priority_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$editColumn = new CustomEditColumn('Priority', 'priority', $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 lead field
//
$editor = new ComboBox('lead_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$editColumn = new CustomEditColumn('Project Lead', 'lead', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_USER_ID%'));
$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 approved_budget field
//
$editor = new TextEdit('approved_budget_edit');
$editor->SetPlaceholder($this->RenderText('currency value without comma'));
$editor->SetPrefix($this->RenderText('$'));
$editor->SetSuffix($this->RenderText('.00'));
$editColumn = new CustomEditColumn('Approved Budget', 'approved_budget', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('0'));
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$validator = new NumberValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('NumberValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for budget_spent field
//
$editor = new TextEdit('budget_spent_edit');
//.........这里部分代码省略.........
示例9: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for idPUC field
//
$editor = new TextEdit('idpuc_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('IdPUC', 'idPUC', $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 Nombre field
//
$editor = new TextEdit('nombre_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('Nombre', 'Nombre', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for Valor field
//
$editor = new TextEdit('valor_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('Valor', 'Valor', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for GupoCuentas_PUC field
//
$editor = new TextEdit('gupocuentas_puc_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('GupoCuentas PUC', 'GupoCuentas_PUC', $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);
if ($this->GetSecurityInfo()->HasAddGrant()) {
$grid->SetShowAddButton(true);
$grid->SetShowInlineAddButton(false);
} else {
$grid->SetShowInlineAddButton(false);
$grid->SetShowAddButton(false);
}
}
示例10: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for IP field
//
$editor = new TextEdit('ip_edit');
$editor->SetSize(25);
$editor->SetMaxLength(25);
$editColumn = new CustomEditColumn('IP', 'IP', $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 NomMachine field
//
$editor = new TextEdit('nommachine_edit');
$editor->SetSize(50);
$editor->SetMaxLength(50);
$editColumn = new CustomEditColumn('NomMachine', 'NomMachine', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for EtatMachine field
//
$editor = new CheckBox('etatmachine_edit');
$editColumn = new CustomEditColumn('EtatMachine', 'EtatMachine', $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 Service1 field
//
$editor = new CheckBox('service1_edit');
$editColumn = new CustomEditColumn('Service1', 'Service1', $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 Service2 field
//
$editor = new CheckBox('service2_edit');
$editColumn = new CustomEditColumn('Service2', 'Service2', $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 Service3 field
//
$editor = new CheckBox('service3_edit');
$editColumn = new CustomEditColumn('Service3', 'Service3', $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);
if ($this->GetSecurityInfo()->HasAddGrant()) {
$grid->SetShowAddButton(true);
$grid->SetShowInlineAddButton(false);
} else {
$grid->SetShowInlineAddButton(false);
$grid->SetShowAddButton(false);
}
}
示例11: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for DEPARTMENT field
//
$editor = new TextEdit('department_edit');
$editor->SetSize(20);
$editor->SetMaxLength(20);
$editColumn = new CustomEditColumn('Department', 'DEPARTMENT', $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 LOCATION field
//
$editor = new TextEdit('location_edit');
$editor->SetSize(20);
$editor->SetMaxLength(20);
$editColumn = new CustomEditColumn('Location', 'LOCATION', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for PHONE_NO field
//
$editor = new TextEdit('phone_no_edit');
$editor->SetSize(20);
$editor->SetMaxLength(20);
$editColumn = new CustomEditColumn('Phone No', 'PHONE_NO', $editor, $this->dataset);
$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);
}
}
示例12: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for Cliente field
//
$editor = new AutocomleteComboBox('cliente_edit', $this->CreateLinkBuilder());
$editor->SetSize('250px');
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`clientes`');
$field = new IntegerField('idClientes', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new IntegerField('Tipo_Documento');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('Num_Identificacion');
$lookupDataset->AddField($field, false);
$field = new IntegerField('DV');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('Primer_Apellido');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('Segundo_Apellido');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('Primer_Nombre');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('Otros_Nombres');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('RazonSocial');
$lookupDataset->AddField($field, false);
$field = new StringField('Direccion');
$lookupDataset->AddField($field, false);
$field = new StringField('Cod_Dpto');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('Cod_Mcipio');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('Pais_Domicilio');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('Telefono');
$lookupDataset->AddField($field, false);
$field = new StringField('Ciudad');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('Contacto');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('TelContacto');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('Email');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('CIUU');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('empresa_id');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('codigo');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('regimen');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('estado');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('RazonSocial', GetOrderTypeAsSQL(otAscending));
$editColumn = new DynamicLookupEditColumn('Cliente', 'Cliente', 'Cliente_RazonSocial', 'insert_Cliente_RazonSocial_search', $editor, $this->dataset, $lookupDataset, 'idClientes', 'RazonSocial', '');
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for Telefono field
//
$editor = new TextEdit('telefono_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('Telefono', 'Telefono', $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 Contacto field
//
$editor = new TextEdit('contacto_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('Contacto', 'Contacto', $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);
//.........这里部分代码省略.........
示例13: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for program_name field
//
$editor = new TextEdit('program_name_edit');
$editor->SetSize(50);
$editor->SetMaxLength(50);
$editColumn = new CustomEditColumn(' Name', 'program_name', $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 description field
//
$editor = new TextAreaEdit('description_edit', 50, 8);
$editColumn = new CustomEditColumn('Description', 'description', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for lead field
//
$editor = new ComboBox('lead_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`staff`');
$field = new IntegerField('staff_id', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('username');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('email');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('picture');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('password');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('dept_id');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('position');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('emp_number');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('username', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('Lead', 'lead', $editor, $this->dataset, 'username', 'username', $lookupDataset);
$editColumn->SetCaptionTemplate($this->RenderText('%username%'));
$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 date_start field
//
$editor = new DateTimeEdit('date_start_edit', false, 'Y-m-d', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Date Start', 'date_start', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
$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 date_end field
//
$editor = new DateTimeEdit('date_end_edit', false, 'Y-m-d', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_DATE%'));
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
if ($this->GetSecurityInfo()->HasAddGrant()) {
$grid->SetShowAddButton(true);
$grid->SetShowInlineAddButton(false);
} else {
$grid->SetShowInlineAddButton(false);
$grid->SetShowAddButton(false);
}
}
示例14: CreateGrid
protected function CreateGrid()
{
$result = new Grid($this, $this->dataset, 'clientesGrid');
if ($this->GetSecurityInfo()->HasDeleteGrant()) {
$result->SetAllowDeleteSelected(false);
} else {
$result->SetAllowDeleteSelected(false);
}
ApplyCommonPageSettings($this, $result);
$result->SetUseImagesForActions(true);
$result->SetUseFixedHeader(false);
$result->SetShowLineNumbers(false);
$result->SetHighlightRowAtHover(false);
$result->SetWidth('');
$this->CreateGridSearchControl($result);
$this->CreateGridAdvancedSearchControl($result);
$this->AddFieldColumns($result);
$this->AddSingleRecordViewColumns($result);
$this->AddEditColumns($result);
$this->AddInsertColumns($result);
$this->AddPrintColumns($result);
$this->AddExportColumns($result);
$this->AddOperationsColumns($result);
$this->SetShowPageList(true);
$this->SetHidePageListByDefault(false);
$this->SetExportToExcelAvailable(true);
$this->SetExportToWordAvailable(true);
$this->SetExportToXmlAvailable(true);
$this->SetExportToCsvAvailable(true);
$this->SetExportToPdfAvailable(true);
$this->SetPrinterFriendlyAvailable(true);
$this->SetSimpleSearchAvailable(true);
$this->SetAdvancedSearchAvailable(true);
$this->SetFilterRowAvailable(true);
$this->SetVisualEffectsEnabled(true);
$this->SetShowTopPageNavigator(true);
$this->SetShowBottomPageNavigator(true);
//
// Http Handlers
//
//
// View column for RazonSocial field
//
$column = new TextViewColumn('RazonSocial', 'RazonSocial', $this->dataset);
$column->SetOrderable(true);
/* <inline edit column> */
//
// Edit column for RazonSocial field
//
$editor = new TextEdit('razonsocial_edit');
$editor->SetSize(100);
$editor->SetMaxLength(100);
$editColumn = new CustomEditColumn('RazonSocial', 'RazonSocial', $editor, $this->dataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$column->SetEditOperationColumn($editColumn);
/* </inline edit column> */
/* <inline insert column> */
//
// Edit column for RazonSocial field
//
$editor = new TextEdit('razonsocial_edit');
$editor->SetSize(100);
$editor->SetMaxLength(100);
$editColumn = new CustomEditColumn('RazonSocial', 'RazonSocial', $editor, $this->dataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
$editor->GetValidatorCollection()->AddValidator($validator);
$this->ApplyCommonColumnEditProperties($editColumn);
$column->SetInsertOperationColumn($editColumn);
/* </inline insert column> */
$handler = new ShowTextBlobHandler($this->dataset, $this, 'RazonSocial_handler', $column);
GetApplication()->RegisterHTTPHandler($handler);
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`cod_departamentos`');
$field = new IntegerField('Cod_dpto');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('Nombre');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('Nombre', GetOrderTypeAsSQL(otAscending));
$lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), ''));
$handler = new DynamicSearchHandler($lookupDataset, $this, 'inline_edit_Cod_Dpto_Nombre_search', 'Cod_dpto', 'Nombre', null);
GetApplication()->RegisterHTTPHandler($handler);
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`cod_departamentos`');
$field = new IntegerField('Cod_dpto');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('Nombre');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('Nombre', GetOrderTypeAsSQL(otAscending));
$lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), ''));
$handler = new DynamicSearchHandler($lookupDataset, $this, 'inline_insert_Cod_Dpto_Nombre_search', 'Cod_dpto', 'Nombre', null);
GetApplication()->RegisterHTTPHandler($handler);
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`cod_paises`');
$field = new IntegerField('Codigo');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('Pais');
//.........这里部分代码省略.........
示例15: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for project_id field
//
$editor = new TextEdit('project_id_edit');
$editColumn = new CustomEditColumn('Project Id', 'project_id', $editor, $this->dataset);
$editColumn->SetAllowSetToDefault(true);
$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 project_type field
//
$editor = new TextEdit('project_type_edit');
$editor->SetSize(50);
$editor->SetMaxLength(50);
$editColumn = new CustomEditColumn('Project Type', 'project_type', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for project_name field
//
$editor = new TextAreaEdit('project_name_edit', 50, 8);
$editColumn = new CustomEditColumn('Project Name', 'project_name', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for date_start field
//
$editor = new DateTimeEdit('date_start_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Date Start', 'date_start', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for date_end field
//
$editor = new DateTimeEdit('date_end_edit', true, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('Date End', 'date_end', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for year field
//
$editor = new TextEdit('year_edit');
$editor->SetSize(4);
$editor->SetMaxLength(4);
$editColumn = new CustomEditColumn('Year', 'year', $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 Objective field
//
$editor = new TextEdit('objective_edit');
$editColumn = new CustomEditColumn('Objective', 'Objective', $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 priority field
//
$editor = new TextEdit('priority_edit');
$editor->SetSize(100);
$editor->SetMaxLength(100);
$editColumn = new CustomEditColumn('Priority', 'priority', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for project_lead field
//
$editor = new TextEdit('project_lead_edit');
$editor->SetSize(100);
$editor->SetMaxLength(100);
$editColumn = new CustomEditColumn('Project Lead', 'project_lead', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for approved_budget field
//
$editor = new TextEdit('approved_budget_edit');
$editColumn = new CustomEditColumn('Approved Budget', 'approved_budget', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for budget_spent field
//
$editor = new TextEdit('budget_spent_edit');
$editColumn = new CustomEditColumn('Budget Spent', 'budget_spent', $editor, $this->dataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
//.........这里部分代码省略.........