[]
        
(Showing Draft Content)

GC.Spread.Sheets.GanttSheet.Project

Class: Project

Sheets.GanttSheet.Project

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Project(name)

Represents a project for scheduling.

Parameters

Name Type Description
name string Indicates the name of this project. The name will apply to the root task also.

Properties

calendar

calendar: Calendar

Gets or sets the calendar for this project. It is the default calendar for all tasks in this project. Note do not modify the members of calendar, instead, please replace the calendar instance to modify.


calendarSettings

calendarSettings: CalendarSettings

Gets the calendar settings for this project, and configure the parameters used for calculating dates and durations.

readonly


count

count: number

Gets the count of tasks and blank rows in this project.

readonly


currentDate

currentDate: Date

Gets or sets the current date of this project. Gantt chart will show a grid line to indicate current date.


dependencies

dependencies: TaskDependency[]

Gets the tasks dependencies in this project. This is a cloned array of the internal tasks dependencies. Call addDependency or removeDependency to modify it.

readonly


finishDate

finishDate: Date

Gets the finish date of this project. By default, the finish date is scheduled by the start date.


layout

layout: TaskbarLayout

Gets the layout for gantt chart, and configure the layout appearance of task bars and links.

readonly


root

root: Task

Gets the root task of this project.

readonly


sorted

sorted: boolean

Indicates the tasks are sorted.

readonly


startDate

startDate: Date

Gets or sets the start date of this project. The scheduling will start from this date.


taskStyleRules

taskStyleRules: Collection<TaskbarStyleRule>

Gets the list of task style rules for gantt chart, and configure the appearance for task with the specified rules.

readonly


tasks

tasks: Task[]

Gets the tasks in this project. This is a cloned array of the internal tasks. Please use getTask if you want to get one task with the specified task number.

readonly


tasksSorted

tasksSorted: Task[]

Gets the tasks in this project in the sorted order. Specially, null indicates a blank row in the array. This is a cloned array of the internal tasks. Please use getTaskByRow if you want to get one task with the specified row index after sort.

readonly


timescale

timescale: Timescale

Gets the timescale for gantt chart, and configure the timescale appearances and locations.

readonly

Methods

addDependency

addDependency(dependencies): void

Adds one or more task dependency for the project.

Parameters

Name Type Description
dependencies ITaskDependency | TaskDependency | TaskDependency[] | ITaskDependency[] Indicates the tasks dependencies to be added.

Returns

void


addTasks

addTasks(data?, level?): Task[]

Adds tasks with the specified count or data for this project.

Parameters

Name Type
data? number | ITaskData | ITaskData[]
level? number

Returns

Task[]

Array of the added tasks.


getTask

getTask(taskNumber): Task

Gets a task with the specified task number. Typically, the task number is the index of the task in project. If the tasks has been sorted, please uses getTaskByRow to get task with the specified row index.

Parameters

Name Type Description
taskNumber number Specifies the task number of the target task.

Returns

Task

The task with the specified task number.


indentTasks

indentTasks(taskNumbers): void

Increases the levels of the specified tasks for this project.

Parameters

Name Type Description
taskNumbers number | number[] A number or number array indicates the number of the tasks to increase levels.

Returns

void


indentTasksByRange

indentTasksByRange(taskNumber, count?): void

Increases the levels of a range of tasks with the continues numbers for this project.

Parameters

Name Type Description
taskNumber number A number indicates the first number of the tasks to increase levels.
count? number -

Returns

void


insertTasks

insertTasks(taskNumber, data?, level?): Task[]

Inserts tasks at the specified position with provided data.

Parameters

Name Type Description
taskNumber number Specifies the target task number to insert.
data? number | ITaskData | ITaskData[] -
level? number -

Returns

Task[]

Array of the inserted tasks.


outdentTasks

outdentTasks(taskNumbers): void

Decreases the levels of the specified tasks for this project.

Parameters

Name Type Description
taskNumbers number | number[] A number or number array indicates the number of the tasks to decrease levels.

Returns

void


outdentTasksByRange

outdentTasksByRange(taskNumber, count?): void

Decreases the levels of a range of tasks with the continues numbers for this project.

Parameters

Name Type Description
taskNumber number A number indicates the first number of the tasks to decrease levels.
count? number -

Returns

void


removeDependency

removeDependency(dependencies): void

Removes one or more task dependency for the project.

Parameters

Name Type Description
dependencies TaskDependency | TaskDependency[] Indicates the tasks dependencies to be removed. Note the dependency instance should be members of project.dependencies.

Returns

void


removeTasks

removeTasks(taskNumbers): void

Removes tasks with the specified task numbers for this project.

Parameters

Name Type Description
taskNumbers number | number[] A number or number array indicates the number of the tasks to be removed.

Returns

void


removeTasksByRange

removeTasksByRange(taskNumber, count?): void

Removes a range of tasks with the continues task numbers for this project.

Parameters

Name Type Description
taskNumber number A number indicates the first number of the tasks to be removed.
count? number -

Returns

void


resumeSchedule

resumeSchedule(): void

Resume the scheduling process after made modifications for multiple tasks or dependencies.

Returns

void


sort

sort(fields, ascendingStates?, keepStructure?, renumber?): void

Sorts the tasks with the specified task fields.

Parameters

Name Type Description
fields string[] Specifies the fields to sort by.
ascendingStates? boolean[] -
keepStructure? boolean -
renumber? boolean -

Returns

void


suspendSchedule

suspendSchedule(): void

Suspends the scheduling process before making modifications for multiple tasks or dependencies.

Returns

void