New data loading logic of sunflower Gantt Chart

Source: Internet
Author: User

Since the release of sunflower Gantt chart, it has attracted the attention of many friends and mentioned many functional requirements, many of which focus on the provision and processing of data, our previous data was fully developed by referring to the data format of the project. However, with the development, we gradually realized that the XML format of the Project is a local application after all. Program You may encounter many problems when directly porting data to the network. Sometimes, we receive the following complaints from users:
1. I have a lot of data. Generating a large XML file seriously affects server performance, and loading such a large XML file browser on the client is also very slow;
2. How can I integrate my data in multiple places?
3. There is no outline in my data, and generating the corresponding ID and outlinenumber for each task is complicated;
4. Can data be downloaded in multiple parts?
Now, we have finally found a solution to this problem, optimized Gantt chart's data processing logic, and started internal testing. Now we will briefly introduce the new processing logic.
In the new data logic, the linear reading logic of data in the project format is no longer used, but the sequential processing logic of XML is used. This logic is briefly introduced as follows:
1. Each outline task reads its subtasks according to the linear logic from top to bottom, and does not have to be read once;
2. If you do not need to read a subtask of an outline task (for example, collapsed), you can skip reading without reading it, instead of reading it before it can be completed in the original projectxml format.
With reference to the above logic, the following functions can be implemented in principle:
1. download a task by outline, that is, to download its subtasks on the server only when a task is clicked to expand. In this way, Gantt data can be flexibly divided into countless small pieces according to the outline, saves servers and bandwidth;
2. for a paging download task, if there are many subtasks under each summary task, when the data is very large, you can download only the specified number per page. When you need to view a location, then download the data at the location;
3. Other more flexible multipart download logic;
Of course, our new data format will have some impact on the existing mode. The biggest impact is the original ID attribute, that is, the column displayed on the left side of the Gantt chart, the data in this column plays an extremely important role in the previous data loading logic, and in the new data processing logic, it has reduced its position, mainly based on the following considerations:
1. when a user has a lot of task data or a lot of sources, it is difficult to assign an ID for each task in order, especially when the data is downloaded in parts, it is not worthwhile to retain an ID for each task not sent to the client;
2. when users modify XML data (especially when adding, deleting, or moving data involves changes to the task outline), Gantt Chart maintains the id value in a complex and most critical way, download all tasks to update their IDs is usually not worth the candle;
3. In the new data structure, the ID value is not required to process related logic;
The id value in the new data architecture will be consistent with the processing method of the original uid value attribute, that is, Gantt chart does not write this attribute only. The original gettaskbyid () method will be retained for compatibility, it is not recommended because this method will consume performance, especially when data is downloaded from the server; the most obvious effect of changing the id value is that after the task order or outline changes, the ID column displayed on the left will not change. Therefore, the ID column on the left will appear strange, we recommend that you display other columns (such as UID) on the left, or simply do not display the left column. If you really want to retain the original ID processing method, maybe our new features won't be available and will cause performance problems;

We have implemented a simple example of multipart data loading. You can click here to view:

Http://www.51diaodu.cn/sfgantt/examples/SFData/xml.htm

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.