JQuery Gantt Edit: (i) parameters and method descriptions

Source: Internet
Author: User
Tags unique id

JQuery Gantt Editor

jquery Gantt Edit (hereinafter referred to as GE) is an open source, jquery-based Gantt chart plugin, author: robicch. GitHub Address: Https://github.com/robicch/jQueryGantt

The first is GE's main features:

    • Based on jquery
    • MIT License: You can reuse it anywhere
    • JSON data transfer
    • Available all over the world
    • Task Management and workflow processing
    • Manage task dependencies (subordinate)
    • Manage Jobs (resources, roles, progress)
    • Server synchronization
    • Support Undo Redo
    • Browser compatible (can be compatible with IE8 and above, other basic support)

How to use

First download the component resources, click I download, the source code inside the gantt.html is already a can use the Gantt chart

Use Firefox or Google to debug your code

First, define a global variable GE; Here is a discussion of scope issues later

var ge = new Ganttmaster ();

Task data modifications to the Gantt Chart can be saved using Ge.saveproject ()

Ge.saveproject ()

Load a project using Ge.loadproject ( [Yourjsonproject] )

Ge.loadproject (JSON)

Project data structure for a Gantt chart

{tasks:[...] Resources: [...] Roles: [...] Deletedtaskids:[...]
Selectedrow:7
Canwrite:true
Canwriteonparent:true
mineditabledate:1349906300000
maxeditabledate:3499063999999}

where tasks,roles,resources are arrays

Tasks: It's a dry tut. The data in the order that is displayed on the Gantt Chart, all parameters of the task data shown here

{"id": "Tmp_fk1345562123031″," "Name": "Approval", "code": "APP", "Level": 2, "status": "Status_suspended", "Start":1348696800000, "duration":ten, "End": 1349906399999, "Startismilestone": false , "Endismilestone": false , "Assigs": [...], "Depends": "7:3,8″," description ":" Approval of testing "," Progress ":
  • ID: Used to synchronize with the server, if it is read from the server data then the task will not be dragged, if the task is created from the client, then the ID will be preceded by a "tmp_" prefix
  • Level: Shaping, is the parameters that determine your task rating, that is, the indentation on the Gantt chart, the root task or the level of the total task is 0, and then the sub-task is levels 1, and so on, and so on, you must be consistent with the task structure, you can not write the n+1 level without n
  • Start,end: Here is a js13 bit timestamp to indicate the start time and end time of the task
  • Duration: The shape of your work, for example, when you have a vacation in your work, the Gantt Chart calculates your end date based on your start time (start) and duration (duration), as explained below
  • Startismilestone, Endismilestone: Boolean, once set to true, the task cannot be moved, you can modify the task time, but the task is not modified with the subtasks and process modifications.
  • Depends: task dependencies, support multi-tasking dependencies (in layman's case, after that), only support dependencies from completion to start state, 7:3,8 means that the task will begin at the maximum of 3 days and the eighth task at the end of the 7th task
  • Status: Indicates the state of the task, the supported state has
    • Status_active: In execution,
    • Status_done: Complete,
    • Status_failed: Failed,
    • status_suspended: Suspend/Suspend,
    • status_undefined: no meaning
  • The state here allows you to use dependencies like a workflow, and joining task B relies on task A. The state of that task B is the suspend/suspend state until the state of task a becomes complete from execution. Complete State conversion information will be presented below
  • Progress: The task progress rate is the percentage. No limit, can exceed 100%
  • Assigs: arrays, task assignments, each of the Assigs objects have the following structure
    {"ResourceId": "Tmp_1″," id ":" Tmp_1345560373990″, "Roleid": "Tmp_1″," effort ":36000000}
      • RESOURCEID: Unique ID, associated with resource
      • Unique ID of the Id:assige object
      • Roleid: Unique role ID, and roles want to associate
      • Effort: expected impact of workload, also 13-bit timestamp

 

Resources: Arrays contain the following data structures

{"id": "Tmp_1″," "Name": "Resource 1″}

Roles: The array contains the following data structures

{"id": "Tmp_1″," "Name": "Project Manager"}

Deletetaskids: The number of deleted tasks, which contains the task data deleted by the client IDs, those whose IDs are beginning with temp will not be saved to the server, but will be silently deleted

Selectedrow: The line that is being edited now

CanWrite: Boolean, if you want to edit/create/delete tasks again, set him to Ture

Canwritonparent: This is a little vague, for example, you are the owner of a sub-task under a complex project, and your modified time is likely to be an image to the top of the project, so you can set it to false to organize changes to the top-project.

Mineditabledate,maxeditabledate: Set minimum and maximum time

State conversion rules

* Note: The case of the state here to differentiate does not support lowercase

    • Any status->status_done: Bag to complete. All activities (execution) in the state, including suspend/suspend and undefined tasks can be set to complete state, subset will be set to completed state
    • Status_failed-Status_done: Failure to complete, no manual setting, nothing to do
    • status_undefined-status_active: Undefined to execution, all child tasks without dependencies (depends) become executed
    • Status_suspended-status_active: From tentative/pending to execution, all subtasks that do not have a dependency (depends) disabled, including subtasks are set to active (temporarily not understood)
    • Status_done-status_active: All those that have dependencies on this task will be set to suspend/suspend
    • Any status-> status_suspended: arbitrary state to suspend/suspend, all subtasks, and subtasks dependent tasks will become paused/suspended, except for failed and forbidden
    • Any status-> status_undefined: arbitrary state to undefined, all subtasks, and subtasks dependent tasks will become paused/suspended, except for failed and forbidden
    • Any status-> status_failed: from any state to failure, all subtasks and subtasks are dependent on the task becoming failed

JQuery Gantt Edit: (i) parameters and method descriptions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.