本文整理汇总了PHP中Grid::SetTotal方法的典型用法代码示例。如果您正苦于以下问题:PHP Grid::SetTotal方法的具体用法?PHP Grid::SetTotal怎么用?PHP Grid::SetTotal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Grid
的用法示例。
在下文中一共展示了Grid::SetTotal方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AddFieldColumns
protected function AddFieldColumns(Grid $grid)
{
//
// View column for name field
//
$column = new TextViewColumn('name', 'Name', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for date field
//
$column = new DateTimeViewColumn('date', 'Timesheet Date', $this->dataset);
$column->SetDateTimeFormat('Y-m-d');
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for task_name field
//
$column = new TextViewColumn('task_name', 'Task Name', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for project_name field
//
$column = new TextViewColumn('project_name', 'Project Name', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for pay_period_number field
//
$column = new TextViewColumn('pay_period_number', 'Pay Period ', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for hours field
//
$column = new TextViewColumn('hours', 'Hours', $this->dataset);
$grid->SetTotal($column, PredefinedAggregate::$Sum);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for position field
//
$column = new TextViewColumn('position', 'Position', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for emp_number field
//
$column = new TextViewColumn('emp_number', 'Emp Number', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
}
示例2: AddFieldColumns
protected function AddFieldColumns(Grid $grid)
{
if (GetCurrentUserGrantForDataSource('project.task')->HasViewGrant()) {
//
// View column for taskDetailView0project detail
//
$column = new DetailColumn(array('project_id'), 'detail0project', 'taskDetailEdit0project_handler', 'taskDetailView0project_handler', $this->dataset, 'Tasks within this project', $this->RenderText('Tasks'));
$grid->AddViewColumn($column);
}
if (GetCurrentUserGrantForDataSource('project.project')->HasViewGrant()) {
//
// View column for projectDetailView1project detail
//
$column = new DetailColumn(array('project_id'), 'detail1project', 'projectDetailEdit1project_handler', 'projectDetailView1project_handler', $this->dataset, 'Project Budget Chart', $this->RenderText('Project Budget'));
$grid->AddViewColumn($column);
}
if (GetCurrentUserGrantForDataSource('project.project_timeline_detail')->HasViewGrant()) {
//
// View column for project_timeline_detailDetailView2project detail
//
$column = new DetailColumn(array('project_id'), 'detail2project', 'project_timeline_detailDetailEdit2project_handler', 'project_timeline_detailDetailView2project_handler', $this->dataset, 'Tasks Gantt view', $this->RenderText('Tasks Gantt view'));
$grid->AddViewColumn($column);
}
//
// View column for program_name field
//
$column = new TextViewColumn('programm_id_program_name', 'Project Type', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for project_name field
//
$column = new TextViewColumn('project_name', 'Project Name', $this->dataset);
$column->SetOrderable(true);
$column->SetEscapeHTMLSpecialChars(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for date_start field
//
$column = new DateTimeViewColumn('date_start', 'Date Start', $this->dataset);
$column->SetDateTimeFormat('Y-m-d');
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for date_end field
//
$column = new DateTimeViewColumn('date_end', 'Date End', $this->dataset);
$column->SetDateTimeFormat('Y-m-d');
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for year field
//
$column = new TextViewColumn('year', 'Year', $this->dataset);
$column->SetOrderable(true);
$column->SetEscapeHTMLSpecialChars(true);
$column->SetWordWrap(false);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for notes field
//
$column = new TextViewColumn('notes', 'Objectives', $this->dataset);
$column->SetOrderable(true);
$column->SetMaxLength(75);
$column->SetFullTextWindowHandlerName('projectGrid_notes_handler_list');
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for Name field
//
$column = new TextViewColumn('priority_Name', 'Priority', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for username field
//
$column = new TextViewColumn('lead_username', 'Project Lead', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for approved_budget field
//
$column = new TextViewColumn('approved_budget', 'Approved Budget', $this->dataset);
$grid->SetTotal($column, PredefinedAggregate::$Sum);
$column->SetOrderable(true);
//.........这里部分代码省略.........
示例3: AddFieldColumns
protected function AddFieldColumns(Grid $grid)
{
//
// View column for name field
//
$column = new TextViewColumn('name', 'Name', $this->dataset);
$column->SetOrderable(true);
$column->SetMaxLength(75);
$column->SetFullTextWindowHandlerName('timesheetDetailEditGrid0taskDetailEdit0department_projects_name_handler_list');
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for task_id field
//
$column = new TextViewColumn('task_id', 'Task Name', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for hours field
//
$column = new TextViewColumn('hours', 'Hours', $this->dataset);
$grid->SetTotal($column, PredefinedAggregate::$Sum);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for notes field
//
$column = new TextViewColumn('notes', 'Notes', $this->dataset);
$column->SetOrderable(true);
$column->SetMaxLength(75);
$column->SetFullTextWindowHandlerName('timesheetDetailEditGrid0taskDetailEdit0department_projects_notes_handler_list');
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for date field
//
$column = new DateTimeViewColumn('date', 'Date', $this->dataset);
$column->SetDateTimeFormat('Y-m-d');
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
}
示例4: AddFieldColumns
protected function AddFieldColumns(Grid $grid)
{
//
// View column for total_hours field
//
$column = new TextViewColumn('total_hours', 'Total Actual Hours', $this->dataset);
$grid->SetTotal($column, PredefinedAggregate::$Sum);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for project_name field
//
$column = new TextViewColumn('project_name', 'Project', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for task_name field
//
$column = new TextViewColumn('task_name', 'Task Name', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for assigned_hours field
//
$column = new TextViewColumn('assigned_hours', 'Assigned Hours', $this->dataset);
$grid->SetTotal($column, PredefinedAggregate::$Sum);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
}
示例5: AddFieldColumns
protected function AddFieldColumns(Grid $grid)
{
//
// View column for program_name field
//
$column = new TextViewColumn('programm_id_program_name', 'Project Type', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for project_name field
//
$column = new TextViewColumn('project_name', 'Project Name', $this->dataset);
$column->SetOrderable(true);
$column->SetMaxLength(75);
$column->SetFullTextWindowHandlerName('projectDetailEditGrid0program_project_name_handler_list');
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for date_start field
//
$column = new DateTimeViewColumn('date_start', 'Date Start', $this->dataset);
$column->SetDateTimeFormat('Y-m-d');
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for date_end field
//
$column = new DateTimeViewColumn('date_end', 'Date End', $this->dataset);
$column->SetDateTimeFormat('Y-m-d');
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for notes field
//
$column = new TextViewColumn('notes', 'Notes', $this->dataset);
$column->SetOrderable(true);
$column->SetMaxLength(75);
$column->SetFullTextWindowHandlerName('projectDetailEditGrid0program_notes_handler_list');
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for priority field
//
$column = new TextViewColumn('priority', 'Priority', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for lead field
//
$column = new TextViewColumn('lead', 'Lead', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for approved_budget field
//
$column = new TextViewColumn('approved_budget', 'Approved Budget', $this->dataset);
$grid->SetTotal($column, PredefinedAggregate::$Sum);
$column->SetOrderable(true);
$column = new CurrencyFormatValueViewColumnDecorator($column, 2, ',', '.', $this->RenderText('$'));
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
}
示例6: AddFieldColumns
protected function AddFieldColumns(Grid $grid)
{
if (GetCurrentUserGrantForDataSource('task.timesheet')->HasViewGrant()) {
//
// View column for timesheetDetailView0task detail
//
$column = new DetailColumn(array('task_id'), 'detail0task', 'timesheetDetailEdit0task_handler', 'timesheetDetailView0task_handler', $this->dataset, 'Timesheet', $this->RenderText('Timesheet'));
$grid->AddViewColumn($column);
}
//
// View column for project_id field
//
$column = new TextViewColumn('project_id', 'Project', $this->dataset);
$column->SetOrderable(true);
$column = new ExtendedHyperLinkColumnDecorator($column, $this->dataset, 'project.php?operation=view&pk0=%project_id%', '');
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for task_name field
//
$column = new TextViewColumn('task_name', 'Name', $this->dataset);
$column->SetOrderable(true);
$column->SetMaxLength(75);
$column->SetFullTextWindowHandlerName('taskGrid_task_name_handler_list');
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for notes field
//
$column = new TextViewColumn('notes', 'Notes', $this->dataset);
$column->SetOrderable(true);
$column->SetMaxLength(75);
$column->SetFullTextWindowHandlerName('taskGrid_notes_handler_list');
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for hrs field
//
$column = new TextViewColumn('hrs', 'Allocated Hours', $this->dataset);
$grid->SetTotal($column, PredefinedAggregate::$Sum);
$column->SetOrderable(true);
$column = new NumberFormatValueViewColumnDecorator($column, 2, ',', '.');
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for assigned_to field
//
$column = new TextViewColumn('assigned_to', 'Assigned To', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for date_start field
//
$column = new DateTimeViewColumn('date_start', 'Date Start', $this->dataset);
$column->SetDateTimeFormat('Y-m-d');
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for date_end field
//
$column = new DateTimeViewColumn('date_end', 'Date End', $this->dataset);
$column->SetDateTimeFormat('Y-m-d');
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
}
示例7: AddFieldColumns
protected function AddFieldColumns(Grid $grid)
{
//
// View column for name field
//
$column = new TextViewColumn('name', 'Name', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for total_hours field
//
$column = new TextViewColumn('total_hours', 'Total Hours', $this->dataset);
$grid->SetTotal($column, PredefinedAggregate::$Sum);
$column->SetOrderable(true);
$column = new NumberFormatValueViewColumnDecorator($column, 2, ',', '.');
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for date field
//
$column = new DateTimeViewColumn('date', 'Date', $this->dataset);
$column->SetDateTimeFormat('Y-m-d');
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for task_name field
//
$column = new TextViewColumn('task_id_task_name', 'Task Id', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
//
// View column for notes field
//
$column = new TextViewColumn('notes', 'Notes', $this->dataset);
$column->SetOrderable(true);
$column->SetDescription($this->RenderText(''));
$column->SetFixedWidth(null);
$grid->AddViewColumn($column);
}