本文整理汇总了PHP中TableDataset::SetOrderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP TableDataset::SetOrderBy方法的具体用法?PHP TableDataset::SetOrderBy怎么用?PHP TableDataset::SetOrderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableDataset
的用法示例。
在下文中一共展示了TableDataset::SetOrderBy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
//.........这里部分代码省略.........
示例2: 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);
}
}
示例3: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for FEC_WINK field
//
$editor = new DateTimeEdit('fec_wink_edit', false, 'Y-m-d H:i:s', GetFirstDayOfWeek());
$editColumn = new CustomEditColumn('FEC WINK', 'FEC_WINK', $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 USERNAME_EMISOR field
//
$editor = new ComboBox('username_emisor_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."PERSONA"');
$field = new StringField('USERNAME');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('ES_ADMIN');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new DateField('NACIMIENTO');
$lookupDataset->AddField($field, false);
$field = new StringField('PRIMER_APELLIDO');
$lookupDataset->AddField($field, false);
$field = new StringField('SEGUNDO_APELLIDO');
$lookupDataset->AddField($field, false);
$field = new StringField('NOMBRE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('GENERO_ID');
$lookupDataset->AddField($field, false);
$field = new IntegerField('CIUDAD_ID');
$lookupDataset->AddField($field, false);
$field = new StringField('SLOGAN');
$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);
$field = new StringField('EMAIL');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('CLAVE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('ES_ADMIN', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('USERNAME EMISOR', 'USERNAME_EMISOR', $editor, $this->dataset, 'USERNAME', 'ES_ADMIN', $lookupDataset);
$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 USERNAME_RECEPTOR field
//
$editor = new ComboBox('username_receptor_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."PERSONA"');
$field = new StringField('USERNAME');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('ES_ADMIN');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new DateField('NACIMIENTO');
$lookupDataset->AddField($field, false);
$field = new StringField('PRIMER_APELLIDO');
$lookupDataset->AddField($field, false);
$field = new StringField('SEGUNDO_APELLIDO');
$lookupDataset->AddField($field, false);
$field = new StringField('NOMBRE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('GENERO_ID');
$lookupDataset->AddField($field, false);
$field = new IntegerField('CIUDAD_ID');
$lookupDataset->AddField($field, false);
$field = new StringField('SLOGAN');
$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);
$field = new StringField('EMAIL');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('CLAVE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('ES_ADMIN', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('USERNAME RECEPTOR', 'USERNAME_RECEPTOR', $editor, $this->dataset, 'USERNAME', 'ES_ADMIN', $lookupDataset);
$validator = new RequiredValidator(StringUtils::Format($this->GetLocalizerCaptions()->GetMessageString('RequiredValidationMessage'), $this->RenderText($editColumn->GetCaption())));
//.........这里部分代码省略.........
示例4: 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 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, 'staff_id', 'username', $lookupDataset);
$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);
}
}
示例5: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for office_id field
//
$editor = new ComboBox('office_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."office"');
$field = new IntegerField('id');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('title');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('num_positions');
$lookupDataset->AddField($field, false);
$field = new StringField('responsibilities');
$lookupDataset->AddField($field, false);
$field = new IntegerField('term_length_months');
$lookupDataset->AddField($field, false);
$field = new StringField('filing_fee');
$lookupDataset->AddField($field, false);
$field = new BooleanField('partisan');
$lookupDataset->AddField($field, false);
$field = new StringField('age_requirements');
$lookupDataset->AddField($field, false);
$field = new StringField('res_requirements');
$lookupDataset->AddField($field, false);
$field = new StringField('prof_requirements');
$lookupDataset->AddField($field, false);
$field = new IntegerField('salary');
$lookupDataset->AddField($field, false);
$field = new StringField('notes');
$lookupDataset->AddField($field, false);
$field = new IntegerField('office_rank');
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('title', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('Office Title', 'office_id', $editor, $this->dataset, 'id', 'title', $lookupDataset);
$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);
}
}
示例6: 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);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for ES_REAL field
//
$editor = new TextEdit('es_real_edit');
$editor->SetSize(1);
$editor->SetMaxLength(1);
$editColumn = new CustomEditColumn('ES REAL', 'ES_REAL', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for EJERCICIO_ID field
//
$editor = new ComboBox('ejercicio_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."EJERCICIO"');
$field = new IntegerField('EJERCICIO_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('EJERCICIO ID', 'EJERCICIO_ID', $editor, $this->dataset, 'EJERCICIO_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
//.........这里部分代码省略.........
$editor = new TextEdit('nombrecuenta_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('NombreCuenta', 'NombreCuenta', $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 Detalle field
//
$editor = new TextEdit('detalle_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('Detalle', 'Detalle', $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 Debito field
//
$editor = new TextEdit('debito_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('Debito', 'Debito', $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 Credito field
//
$editor = new TextEdit('credito_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('Credito', 'Credito', $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 Neto field
//
$editor = new TextEdit('neto_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('Neto', 'Neto', $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 Mayor field
//
$editor = new ComboBox('mayor_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$editor->AddValue('NO', $this->RenderText('NO'));
$editor->AddValue('SI', $this->RenderText('SI'));
$editColumn = new CustomEditColumn('Mayor', 'Mayor', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$editColumn->SetInsertDefaultValue($this->RenderText('NO'));
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for servicio_id field
//
$editor = new ComboBox('servicio_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`servicio`');
$field = new IntegerField('id', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new IntegerField('empresa_id');
$lookupDataset->AddField($field, false);
$field = new StringField('nombre');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('estado');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('nombre', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('Servicio Id', 'servicio_id', $editor, $this->dataset, 'id', 'nombre', $lookupDataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for empresa_id field
//
$editor = new TextEdit('empresa_id_edit');
$editColumn = new CustomEditColumn('Empresa Id', 'empresa_id', $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);
}
}
示例8: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for district_id field
//
$editor = new MultiLevelComboBoxEditor('district_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"."district"');
$field = new IntegerField('id');
$field->SetIsNotNull(true);
$dataset1->AddField($field, true);
$field = new StringField('state');
$dataset1->AddField($field, false);
$field = new StringField('name');
$dataset1->AddField($field, false);
$field = new StringField('level_id');
$dataset1->AddField($field, false);
$field = new IntegerField('election_div_id');
$dataset1->AddField($field, false);
$editor->AddLevel($dataset1, 'id', 'name', $this->RenderText('Political District Name'), new ForeignKeyInfo('abbr', 'state'));
$editColumn = new MultiLevelLookupEditColumn('Political District Name', 'district_id', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for office_id field
//
$editor = new MultiLevelComboBoxEditor('office_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);
$selectQuery = 'SELECT op.id office_id, o.title office_title, ed.id election_div_id, ed.name ed_name, ed.phys_addr_state state, concat(d.name, \' - \', o.title) officeTitle
FROM office_position op
JOIN district d ON op.district_id = d.id
JOIN election_div ed ON d.election_div_id = ed.id
JOIN office o ON op.office_id = o.id';
$insertQuery = array();
$updateQuery = array();
$deleteQuery = array();
$dataset1 = new QueryDataset(new PgConnectionFactory(), GetConnectionOptions(), $selectQuery, $insertQuery, $updateQuery, $deleteQuery, 'office_title_by_election_div');
$field = new IntegerField('office_id');
$dataset1->AddField($field, false);
$field = new StringField('office_title');
$dataset1->AddField($field, false);
$field = new IntegerField('election_div_id');
$dataset1->AddField($field, true);
$field = new StringField('ed_name');
$dataset1->AddField($field, false);
$field = new StringField('state');
$dataset1->AddField($field, false);
$field = new StringField('officetitle');
$dataset1->AddField($field, false);
$editor->AddLevel($dataset1, 'election_div_id', 'election_div_name', $this->RenderText('Election Division'), new ForeignKeyInfo('abbr', 'election_div_state'));
$dataset2 = new TableDataset(new PgConnectionFactory(), GetConnectionOptions(), '"public"."office"');
$field = new IntegerField('id');
$field->SetIsNotNull(true);
$dataset2->AddField($field, true);
$field = new StringField('title');
$field->SetIsNotNull(true);
$dataset2->AddField($field, false);
$field = new IntegerField('num_positions');
$dataset2->AddField($field, false);
$field = new StringField('responsibilities');
$dataset2->AddField($field, false);
$field = new IntegerField('term_length_months');
$dataset2->AddField($field, false);
$field = new StringField('filing_fee');
$dataset2->AddField($field, false);
$field = new BooleanField('partisan');
$dataset2->AddField($field, false);
$field = new StringField('age_requirements');
$dataset2->AddField($field, false);
$field = new StringField('res_requirements');
$dataset2->AddField($field, false);
$field = new StringField('prof_requirements');
$dataset2->AddField($field, false);
$field = new IntegerField('salary');
$dataset2->AddField($field, false);
$field = new StringField('notes');
$dataset2->AddField($field, false);
$field = new IntegerField('office_rank');
$dataset2->AddField($field, false);
$dataset2->SetOrderBy('title', GetOrderTypeAsSQL(otAscending));
$editor->AddLevel($dataset2, 'id', 'title', $this->RenderText('Office Title'), new ForeignKeyInfo('election_div_id', 'election_div_id'));
$editColumn = new MultiLevelLookupEditColumn('Office Title', 'office_id', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for office_holder_id field
//.........这里部分代码省略.........
示例9: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for name field
//
$editor = new TextEdit('name_edit');
$editor->SetSize(50);
$editor->SetMaxLength(100);
$editColumn = new CustomEditColumn('Name', 'name', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('%CURRENT_USER_NAME%'));
$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 task_id field
//
$editor = new MultiLevelComboBoxEditor('task_id_edit', $this->CreateLinkBuilder());
$dataset0 = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`project`');
$field = new IntegerField('project_id', null, null, true);
$field->SetIsNotNull(true);
$dataset0->AddField($field, true);
$field = new IntegerField('programm_id');
$dataset0->AddField($field, false);
$field = new StringField('project_name');
$dataset0->AddField($field, false);
$field = new DateField('date_start');
$dataset0->AddField($field, false);
$field = new DateField('date_end');
$dataset0->AddField($field, false);
$field = new IntegerField('approved_budget');
$dataset0->AddField($field, false);
$field = new StringField('notes');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new StringField('priority');
$dataset0->AddField($field, false);
$field = new StringField('lead');
$dataset0->AddField($field, false);
$field = new StringField('level_of_service');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new StringField('multi_year');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new StringField('public_engagement');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new StringField('year');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new StringField('approved');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new StringField('progress');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new IntegerField('staff_id');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new IntegerField('dept_id');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new IntegerField('budget_spent');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$field = new IntegerField('admin_flag');
$field->SetIsNotNull(true);
$dataset0->AddField($field, false);
$editor->AddLevel($dataset0, 'project_id', 'project_name', $this->RenderText('Project'), null);
$dataset1 = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`task`');
$field = new IntegerField('task_id', null, null, true);
$field->SetIsNotNull(true);
$dataset1->AddField($field, true);
$field = new IntegerField('project_id');
$dataset1->AddField($field, false);
$field = new StringField('assigned_to');
$dataset1->AddField($field, false);
$field = new DateField('date_start');
$dataset1->AddField($field, false);
$field = new DateField('date_end');
$dataset1->AddField($field, false);
$field = new StringField('task_name');
$dataset1->AddField($field, false);
$field = new StringField('notes');
$field->SetIsNotNull(true);
$dataset1->AddField($field, false);
$field = new IntegerField('hrs');
$dataset1->AddField($field, false);
$field = new StringField('wo');
$dataset1->AddField($field, false);
$field = new IntegerField('staff_id');
$dataset1->AddField($field, false);
$dataset1->SetOrderBy('task_name', GetOrderTypeAsSQL(otAscending));
$editor->AddLevel($dataset1, 'task_id', 'task_name', $this->RenderText('Task'), new ForeignKeyInfo('project_id', 'project_id'));
$editColumn = new MultiLevelLookupEditColumn('Task', 'task_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);
//.........这里部分代码省略.........
示例10: CreateGrid
protected function CreateGrid()
{
$result = new Grid($this, $this->dataset, 'taskGrid');
if ($this->GetSecurityInfo()->HasDeleteGrant()) {
$result->SetAllowDeleteSelected(true);
} else {
$result->SetAllowDeleteSelected(false);
}
ApplyCommonPageSettings($this, $result);
$result->SetUseImagesForActions(true);
$result->SetUseFixedHeader(false);
$result->SetShowLineNumbers(false);
$result->SetHighlightRowAtHover(false);
$result->SetWidth('');
$result->OnCustomRenderTotal->AddListener('taskGrid' . '_' . 'OnCustomRenderTotal', $this);
$result->BeforeUpdateRecord->AddListener('taskGrid' . '_' . 'BeforeUpdateRecord', $this);
$result->BeforeDeleteRecord->AddListener('taskGrid' . '_' . 'BeforeDeleteRecord', $this);
$result->BeforeInsertRecord->AddListener('taskGrid' . '_' . 'BeforeInsertRecord', $this);
$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(true);
$this->SetExportToWordAvailable(true);
$this->SetExportToXmlAvailable(false);
$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
//
$pageView = new timesheetDetailView0taskPage($this, 'Timesheet', 'Timesheet', array('task_id'), GetCurrentUserGrantForDataSource('task.timesheet'), 'UTF-8', 20, 'timesheetDetailEdit0task_handler');
$pageView->SetRecordPermission(GetCurrentUserRecordPermissionsForDataSource('task.timesheet'));
$handler = new PageHTTPHandler('timesheetDetailView0task_handler', $pageView);
GetApplication()->RegisterHTTPHandler($handler);
$pageEdit = new timesheetDetailEdit0taskPage($this, array('task_id'), array('task_id'), $this->GetForeingKeyFields(), $this->CreateMasterDetailRecordGridFortimesheetDetailEdit0taskGrid(), $this->dataset, GetCurrentUserGrantForDataSource('task.timesheet'), 'UTF-8');
$pageEdit->SetRecordPermission(GetCurrentUserRecordPermissionsForDataSource('task.timesheet'));
$pageEdit->SetShortCaption('Timesheet');
$pageEdit->SetHeader(GetPagesHeader());
$pageEdit->SetFooter(GetPagesFooter());
$pageEdit->SetCaption('Timesheet');
$pageEdit->SetHttpHandlerName('timesheetDetailEdit0task_handler');
$handler = new PageHTTPHandler('timesheetDetailEdit0task_handler', $pageEdit);
GetApplication()->RegisterHTTPHandler($handler);
//
// View column for Name field
//
$column = new TextViewColumn('task_name_Name', 'Name', $this->dataset);
$column->SetOrderable(true);
$handler = new ShowTextBlobHandler($this->dataset, $this, 'taskGrid_Name_handler_list', $column);
GetApplication()->RegisterHTTPHandler($handler);
//
// View column for notes field
//
$column = new TextViewColumn('notes', 'Notes', $this->dataset);
$column->SetOrderable(true);
$handler = new ShowTextBlobHandler($this->dataset, $this, 'taskGrid_notes_handler_list', $column);
GetApplication()->RegisterHTTPHandler($handler);
//
// View column for Name field
//
$column = new TextViewColumn('task_name_Name', 'Name', $this->dataset);
$column->SetOrderable(true);
$handler = new ShowTextBlobHandler($this->dataset, $this, 'taskGrid_Name_handler_view', $column);
GetApplication()->RegisterHTTPHandler($handler);
//
// View column for notes field
//
$column = new TextViewColumn('notes', 'Notes', $this->dataset);
$column->SetOrderable(true);
$handler = new ShowTextBlobHandler($this->dataset, $this, 'taskGrid_notes_handler_view', $column);
GetApplication()->RegisterHTTPHandler($handler);
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`task_names`');
$field = new IntegerField('id', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('Name');
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('Name', GetOrderTypeAsSQL(otAscending));
$lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), ''));
$handler = new DynamicSearchHandler($lookupDataset, $this, 'edit_task_name_Name_search', 'Name', 'Name', null);
GetApplication()->RegisterHTTPHandler($handler);
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`task_names`');
$field = new IntegerField('id', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('Name');
//.........这里部分代码省略.........
示例11: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for Referencia field
//
$editor = new TextEdit('referencia_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('Referencia', 'Referencia', $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 NombreAct field
//
$editor = new TextAreaEdit('nombreact_edit', 50, 8);
$editColumn = new CustomEditColumn('NombreAct', 'NombreAct', $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 Marca field
//
$editor = new TextEdit('marca_edit');
$editor->SetSize(100);
$editor->SetMaxLength(100);
$editColumn = new CustomEditColumn('Marca', 'Marca', $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 Serie field
//
$editor = new TextEdit('serie_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('Serie', 'Serie', $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 ValorEstimado field
//
$editor = new TextEdit('valorestimado_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('ValorEstimado', 'ValorEstimado', $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 Bodega field
//
$editor = new ComboBox('bodega_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`bodega`');
$field = new IntegerField('idBodega', null, null, true);
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('Nombre');
$lookupDataset->AddField($field, false);
$field = new StringField('Direccion');
$lookupDataset->AddField($field, false);
$field = new StringField('Ciudad');
$lookupDataset->AddField($field, false);
$field = new StringField('Telefono');
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('Nombre', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('Bodega', 'Bodega', $editor, $this->dataset, 'idBodega', 'Nombre', $lookupDataset);
$editColumn->SetInsertDefaultValue($this->RenderText('1'));
$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 CuentaPUC field
//
$editor = new TextEdit('cuentapuc_edit');
$editor->SetSize(45);
$editor->SetMaxLength(45);
$editColumn = new CustomEditColumn('CuentaPUC', 'CuentaPUC', $editor, $this->dataset);
$editColumn->SetInsertDefaultValue($this->RenderText('1520'));
$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);
}
}
示例12: 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);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for ES_REAL field
//
$editor = new TextEdit('es_real_edit');
$editor->SetSize(1);
$editor->SetMaxLength(1);
$editColumn = new CustomEditColumn('ES REAL', 'ES_REAL', $editor, $this->dataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for MASCOTA_ID field
//
$editor = new ComboBox('mascota_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."MASCOTA"');
$field = new IntegerField('MASCOTA_ID');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('TIPO');
$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('TIPO', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('MASCOTA ID', 'MASCOTA_ID', $editor, $this->dataset, 'MASCOTA_ID', 'TIPO', $lookupDataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for CANTIDAD field
//
$editor = new TextEdit('cantidad_edit');
$editColumn = new CustomEditColumn('CANTIDAD', 'CANTIDAD', $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);
}
}
示例13: AddFieldColumns
//.........这里部分代码省略.........
$column->SetOrderable(true);
/* <inline edit column> */
//
// Edit column for task_id field
//
$editor = new ComboBox('task_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`taskview`');
$field = new IntegerField('task_id');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('project_id');
$lookupDataset->AddField($field, false);
$field = new StringField('assigned_to');
$lookupDataset->AddField($field, false);
$field = new DateField('date_start');
$lookupDataset->AddField($field, false);
$field = new DateField('date_end');
$lookupDataset->AddField($field, false);
$field = new StringField('task_name');
$lookupDataset->AddField($field, false);
$field = new StringField('notes');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('hrs');
$lookupDataset->AddField($field, false);
$field = new StringField('wo');
$lookupDataset->AddField($field, false);
$field = new IntegerField('staff_id');
$lookupDataset->AddField($field, false);
$field = new StringField('Task');
$lookupDataset->AddField($field, false);
$field = new StringField('Assigned');
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('Task', GetOrderTypeAsSQL(otAscending));
$lookupDataset->AddCustomCondition(EnvVariablesUtils::EvaluateVariableTemplate($this->GetColumnVariableContainer(), 'assigned_to=%CURRENT_USER_ID%'));
$editColumn = new LookUpEditColumn('Project & Task', 'task_id', $editor, $this->dataset, 'task_id', 'Task', $lookupDataset);
$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 task_id field
//
$editor = new ComboBox('task_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new MyConnectionFactory(), GetConnectionOptions(), '`taskview`');
$field = new IntegerField('task_id');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('project_id');
$lookupDataset->AddField($field, false);
$field = new StringField('assigned_to');
$lookupDataset->AddField($field, false);
$field = new DateField('date_start');
$lookupDataset->AddField($field, false);
$field = new DateField('date_end');
$lookupDataset->AddField($field, false);
$field = new StringField('task_name');
$lookupDataset->AddField($field, false);
$field = new StringField('notes');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('hrs');
$lookupDataset->AddField($field, false);
$field = new StringField('wo');
示例14: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for INTERES_ID field
//
$editor = new ComboBox('interes_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."INTERES"');
$field = new IntegerField('INTERES_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('INTERES ID', 'INTERES_ID', $editor, $this->dataset, 'INTERES_ID', 'NOMBRE', $lookupDataset);
$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 CATEGORIA_INTERES_ID field
//
$editor = new ComboBox('categoria_interes_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."CATEGORIA_INTERES"');
$field = new IntegerField('CATEGORIA_INTERES_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('CATEGORIA INTERES ID', 'CATEGORIA_INTERES_ID', $editor, $this->dataset, 'CATEGORIA_INTERES_ID', 'NOMBRE', $lookupDataset);
$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);
}
}
示例15: AddInsertColumns
protected function AddInsertColumns(Grid $grid)
{
//
// Edit column for USERNAME field
//
$editor = new ComboBox('username_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."PERSONA"');
$field = new StringField('USERNAME');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, true);
$field = new StringField('ES_ADMIN');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new DateField('NACIMIENTO');
$lookupDataset->AddField($field, false);
$field = new StringField('PRIMER_APELLIDO');
$lookupDataset->AddField($field, false);
$field = new StringField('SEGUNDO_APELLIDO');
$lookupDataset->AddField($field, false);
$field = new StringField('NOMBRE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new IntegerField('GENERO_ID');
$lookupDataset->AddField($field, false);
$field = new IntegerField('CIUDAD_ID');
$lookupDataset->AddField($field, false);
$field = new StringField('SLOGAN');
$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);
$field = new StringField('EMAIL');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$field = new StringField('CLAVE');
$field->SetIsNotNull(true);
$lookupDataset->AddField($field, false);
$lookupDataset->SetOrderBy('ES_ADMIN', GetOrderTypeAsSQL(otAscending));
$editColumn = new LookUpEditColumn('USERNAME', 'USERNAME', $editor, $this->dataset, 'USERNAME', 'ES_ADMIN', $lookupDataset);
$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_REAL field
//
$editor = new TextEdit('es_real_edit');
$editor->SetSize(1);
$editor->SetMaxLength(1);
$editColumn = new CustomEditColumn('ES REAL', 'ES_REAL', $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 COLOR_OJOS_ID field
//
$editor = new ComboBox('color_ojos_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."COLOR_OJOS"');
$field = new IntegerField('COLOR_OJOS_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('COLOR OJOS ID', 'COLOR_OJOS_ID', $editor, $this->dataset, 'COLOR_OJOS_ID', 'NOMBRE', $lookupDataset);
$editColumn->SetAllowSetToNull(true);
$this->ApplyCommonColumnEditProperties($editColumn);
$grid->AddInsertColumn($editColumn);
//
// Edit column for COLOR_PIEL_ID field
//
$editor = new ComboBox('color_piel_id_edit', $this->GetLocalizerCaptions()->GetMessageString('PleaseSelect'));
$lookupDataset = new TableDataset(new OracleConnectionFactory(), GetConnectionOptions(), '"GE"."COLOR_PIEL"');
$field = new IntegerField('COLOR_PIEL_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);
//.........这里部分代码省略.........