Could you please help me write some codes in my demo... Thanks a lot!!!
Support Forum
{"eventsData":[{"id":"ade9b550-d3a6-4d94-8023-0b48c3421d7b","parentIndex":0,"startDate":"2021-12-16T00:00:00+08:00","endDate":"2021-12-17T00:00:00+08:00","duration":1,"durationUnit":"day","cls":"","iconCls":null,"style":null,"name":"11111111111","direction":"Forward","manuallyScheduled":false,"constraintType":"startnoearlierthan","constraintDate":"2021-12-16T00:00:00+08:00","percentDone":0,"inactive":null,"effort":24,"effortUnit":"hour","effortDriven":false,"schedulingMode":"Normal","expanded":null,"baselines":[],"note":null,"parentId":null,"showInTimeline":null,"rollup":null,"deadlineDate":null,"taskIconCls":null,"phantomId":null},{"id":"9473e4c9-2e89-4bb1-a0bf-127569c17e8d","parentIndex":1,"startDate":"2021-12-16T00:00:00+08:00","endDate":"2021-12-19T00:00:00+08:00","duration":3,"durationUnit":"day","cls":"","iconCls":null,"style":null,"name":"大多数都是","direction":"Forward","manuallyScheduled":false,"constraintType":null,"constraintDate":null,"percentDone":0,"inactive":null,"effort":72,"effortUnit":"hour","effortDriven":false,"schedulingMode":"Normal","expanded":null,"baselines":[],"note":null,"parentId":null,"showInTimeline":null,"rollup":null,"deadlineDate":null,"taskIconCls":null,"phantomId":null},{"id":"73f8204a-899e-4477-89a3-02445d9211eb","parentIndex":2,"startDate":"2021-12-16T00:00:00+08:00","endDate":"2021-12-17T00:00:00+08:00","duration":1,"durationUnit":"day","cls":"","iconCls":null,"style":null,"name":"12132","direction":"Forward","manuallyScheduled":false,"constraintType":null,"constraintDate":null,"percentDone":0,"inactive":null,"effort":24,"effortUnit":"hour","effortDriven":false,"schedulingMode":"Normal","expanded":null,"baselines":[],"note":null,"parentId":null,"showInTimeline":null,"rollup":null,"deadlineDate":null,"taskIconCls":null,"phantomId":null},{"id":"27b4868c-5c06-4079-8e13-3c35c96eb413","parentIndex":3,"startDate":"2021-12-16T00:00:00+08:00","endDate":"2021-12-17T00:00:00+08:00","duration":1,"durationUnit":"day","cls":"","iconCls":null,"style":null,"name":"sdffsd","direction":"Forward","manuallyScheduled":false,"constraintType":null,"constraintDate":null,"percentDone":0,"inactive":null,"effort":24,"effortUnit":"hour","effortDriven":false,"schedulingMode":"Normal","expanded":null,"baselines":[],"note":null,"parentId":null,"showInTimeline":null,"rollup":null,"deadlineDate":null,"taskIconCls":null,"phantomId":null},{"id":"1ca51908-12e4-45a1-94b2-7cf4a7aa2297","parentIndex":4,"startDate":"2021-12-24T00:00:00+08:00","endDate":"2021-12-25T00:00:00+08:00","duration":1,"durationUnit":"day","cls":"","iconCls":null,"style":null,"name":"eewe","direction":"Forward","manuallyScheduled":false,"constraintType":"startnoearlierthan","constraintDate":"2021-12-24T00:00:00+08:00","percentDone":0,"inactive":null,"effort":24,"effortUnit":"hour","effortDriven":false,"schedulingMode":"Normal","expanded":null,"baselines":[],"note":null,"parentId":null,"showInTimeline":null,"rollup":null,"deadlineDate":null,"taskIconCls":null,"phantomId":null},{"id":"442f8df5-f95b-458b-bebb-93d3f58edcae","parentIndex":5,"startDate":"2021-12-16T00:00:00+08:00","endDate":"2021-12-17T00:00:00+08:00","duration":1,"durationUnit":"day","cls":"","iconCls":null,"style":null,"name":"sdffsd","direction":"Forward","manuallyScheduled":false,"constraintType":null,"constraintDate":null,"percentDone":0,"inactive":null,"effort":24,"effortUnit":"hour","effortDriven":false,"schedulingMode":"Normal","expanded":null,"baselines":[],"note":null,"parentId":null,"showInTimeline":null,"rollup":null,"deadlineDate":null,"taskIconCls":null,"phantomId":null},{"id":"02638bde-ab09-4de4-9eb0-95fab65cf68f","parentIndex":6,"startDate":"2021-12-16T00:00:00+08:00","endDate":"2021-12-17T00:00:00+08:00","duration":1,"durationUnit":"day","cls":"","iconCls":null,"style":null,"name":"9999","direction":"Forward","manuallyScheduled":false,"constraintType":null,"constraintDate":null,"percentDone":0,"inactive":null,"effort":24,"effortUnit":"hour","effortDriven":false,"schedulingMode":"Normal","expanded":null,"baselines":[],"note":null,"parentId":null,"showInTimeline":null,"rollup":null,"deadlineDate":null,"taskIconCls":null,"phantomId":null},{"id":"4bc7a61a-f8cd-4940-b084-9b2270ed048a","parentIndex":7,"startDate":"2021-12-16T00:00:00+08:00","endDate":"2021-12-17T00:00:00+08:00","duration":1,"durationUnit":"day","cls":"","iconCls":null,"style":null,"name":"d","direction":"Forward","manuallyScheduled":false,"constraintType":null,"constraintDate":null,"percentDone":0,"inactive":null,"effort":24,"effortUnit":"hour","effortDriven":false,"schedulingMode":"Normal","expanded":null,"baselines":[],"note":null,"parentId":null,"showInTimeline":null,"rollup":null,"deadlineDate":null,"taskIconCls":null,"phantomId":null},{"id":"deaa83c5-a413-43c2-a741-d4de5ccdf1ce","parentIndex":8,"startDate":"2021-12-16T00:00:00+08:00","endDate":"2021-12-17T00:00:00+08:00","duration":1,"durationUnit":"day","cls":"","iconCls":null,"style":null,"name":"sdsd","direction":"Forward","manuallyScheduled":false,"constraintType":null,"constraintDate":null,"percentDone":0,"inactive":null,"effort":24,"effortUnit":"hour","effortDriven":false,"schedulingMode":"Normal","expanded":null,"baselines":[],"note":null,"parentId":null,"showInTimeline":null,"rollup":null,"deadlineDate":null,"taskIconCls":null,"phantomId":null},{"id":"4c31fff1-b342-45bb-95e0-c33a3676de01","parentIndex":9,"startDate":"2021-12-16T00:00:00+08:00","endDate":"2021-12-17T00:00:00+08:00","duration":1,"durationUnit":"day","cls":"","iconCls":null,"style":null,"name":"ds","direction":"Forward","manuallyScheduled":false,"constraintType":null,"constraintDate":null,"percentDone":0,"inactive":null,"effort":24,"effortUnit":"hour","effortDriven":false,"schedulingMode":"Normal","expanded":null,"baselines":[],"note":null,"parentId":null,"showInTimeline":null,"rollup":null,"deadlineDate":null,"taskIconCls":null,"phantomId":null}],"resourcesData":[{"id":"28002002","name":"Wu, Huihua","image":"28002002.jpg"},{"id":"28005518","name":"Pu, Yujie","image":"28005518.jpg"},{"id":"28005557","name":"Zhang, Yu","image":"28005557.jpg"}],"dependenciesData":[{"id":"c16ce227-4708-4f8e-963c-201888fbdc0a","type":2,"cls":"","lag":0,"lagUnit":"day","fromTask":null,"toTask":null},{"id":"7b5dfe96-b178-4d89-803c-3039ff8c2167","type":2,"cls":"","lag":0,"lagUnit":"day","fromTask":null,"toTask":null},{"id":"181c3eea-3635-4aed-bc52-7a0ee901d696","type":2,"cls":"","lag":0,"lagUnit":"day","fromTask":null,"toTask":null},{"id":"3fe12de2-666e-4871-b930-869b5305589d","type":2,"cls":"","lag":0,"lagUnit":"day","fromTask":null,"toTask":null},{"id":"9cff8a16-2908-44b0-9938-e4610a402d1b","type":2,"cls":"","lag":0,"lagUnit":"day","fromTask":null,"toTask":null}],"assignmentsData":[{"id":"ade9b550-d3a6-4d94-8023-0b48c3421d7b","resource":"28005518","units":100,"resourceId":"28005518","task":"ade9b550-d3a6-4d94-8023-0b48c3421d7b"},{"id":"1e48c0f7-fb71-84cc-8477-325e1324deb8","units":100,"task":"1e48c0f7-fb71-84cc-8477-325e1324deb8"},{"id":"5209df69-7974-4ad2-a276-4dc8c118840a","units":100,"task":"5209df69-7974-4ad2-a276-4dc8c118840a"},{"id":"202339b9-e0a0-7de2-e277-b0f23b34b9be","units":100,"task":"202339b9-e0a0-7de2-e277-b0f23b34b9be"},{"id":"6f399338-7946-49f0-9cb6-4ff4e0b588f5","units":100,"task":"6f399338-7946-49f0-9cb6-4ff4e0b588f5"},{"id":"b8ac277c-58a1-e94b-b2a7-5843f733a522","units":100,"task":"b8ac277c-58a1-e94b-b2a7-5843f733a522"},{"id":"85b73ad5-7fe5-4d2d-a0e4-585e2951cff6","units":100,"task":"85b73ad5-7fe5-4d2d-a0e4-585e2951cff6"},{"id":"8727b94e-5827-8c8a-52d2-7b8bd548c39d","units":100,"task":"8727b94e-5827-8c8a-52d2-7b8bd548c39d"},{"id":"ef5b6769-3a15-4cd9-9088-7d579110d7c7","units":100,"task":"ef5b6769-3a15-4cd9-9088-7d579110d7c7"},{"id":"977b0f54-c517-8a01-d17c-9bce603d11d8","units":100,"task":"977b0f54-c517-8a01-d17c-9bce603d11d8"},{"id":"a4e24bca-89e0-9b7a-6d7a-b45a7f2dda1d","units":100,"task":"a4e24bca-89e0-9b7a-6d7a-b45a7f2dda1d"},{"id":"1d17bb5b-9e76-8d9a-891c-c3198a6b59e3","units":100,"task":"1d17bb5b-9e76-8d9a-891c-c3198a6b59e3"},{"id":"4c31fff1-b342-45bb-95e0-c33a3676de01","resource":"28002002","units":100,"resourceId":"28002002","task":"4c31fff1-b342-45bb-95e0-c33a3676de01"}]}
This is my data.I uploaded the data with 'this.gantt.project.loadInlineData()'.All of the data can display except for the assigned resources column.Why is this?
This is my data.I uploaded the data with 'this.gantt.project.loadInlineData()'.All of the data can display except for the assigned resources column.Why is this?
assignmentStore requires special data format that includes eventId
/resourceId
fields of event
/resource
fields.
In your case I see the next:
"assignmentsData": [
{
"id": "ade9b550-d3a6-4d94-8023-0b48c3421d7b",
"resource": "28005518",
"units": 100,
"resourceId": "28005518",
"task": "ade9b550-d3a6-4d94-8023-0b48c3421d7b"
},
{
"id": "1e48c0f7-fb71-84cc-8477-325e1324deb8",
"units": 100,
"task": "1e48c0f7-fb71-84cc-8477-325e1324deb8"
},
{
"id": "5209df69-7974-4ad2-a276-4dc8c118840a",
"units": 100,
"task": "5209df69-7974-4ad2-a276-4dc8c118840a"
},
{
"id": "202339b9-e0a0-7de2-e277-b0f23b34b9be",
"units": 100,
"task": "202339b9-e0a0-7de2-e277-b0f23b34b9be"
},
{
"id": "6f399338-7946-49f0-9cb6-4ff4e0b588f5",
"units": 100,
"task": "6f399338-7946-49f0-9cb6-4ff4e0b588f5"
},
{
"id": "b8ac277c-58a1-e94b-b2a7-5843f733a522",
"units": 100,
"task": "b8ac277c-58a1-e94b-b2a7-5843f733a522"
},
{
"id": "85b73ad5-7fe5-4d2d-a0e4-585e2951cff6",
"units": 100,
"task": "85b73ad5-7fe5-4d2d-a0e4-585e2951cff6"
},
{
"id": "8727b94e-5827-8c8a-52d2-7b8bd548c39d",
"units": 100,
"task": "8727b94e-5827-8c8a-52d2-7b8bd548c39d"
},
{
"id": "ef5b6769-3a15-4cd9-9088-7d579110d7c7",
"units": 100,
"task": "ef5b6769-3a15-4cd9-9088-7d579110d7c7"
},
{
"id": "977b0f54-c517-8a01-d17c-9bce603d11d8",
"units": 100,
"task": "977b0f54-c517-8a01-d17c-9bce603d11d8"
},
{
"id": "a4e24bca-89e0-9b7a-6d7a-b45a7f2dda1d",
"units": 100,
"task": "a4e24bca-89e0-9b7a-6d7a-b45a7f2dda1d"
},
{
"id": "1d17bb5b-9e76-8d9a-891c-c3198a6b59e3",
"units": 100,
"task": "1d17bb5b-9e76-8d9a-891c-c3198a6b59e3"
},
{
"id": "4c31fff1-b342-45bb-95e0-c33a3676de01",
"resource": "28002002",
"units": 100,
"resourceId": "28002002",
"task": "4c31fff1-b342-45bb-95e0-c33a3676de01"
}
]
Please check your data format and let us know if it helped.
All about working with data is here: https://bryntum.com/docs/gantt/guide/Gantt/data/project_data
Could you please help me write some codes in my demo... Thanks a lot!!!
all you need is get the gantt.project
instance in your event handler, that may be found in context.source
according to docs https://bryntum.com/docs/gantt/api/Gantt/model/ProjectModel#event-change . project
instance has all stores you need, just take all required information from it and use as you want. We provided links to docs to get changes
only, or all records
, or json
data. Check here: https://bryntum.com/docs/gantt/api/Gantt/model/ProjectModel
And the guide I provided above https://bryntum.com/docs/gantt/guide/Gantt/data/project_data#working-with-inline-data
All the best,
Alex