implement CRUD with MSImport

Show cool things you have done with our products


User avatar
Dev_Coppelis
Premium Member
Premium Member
Posts: 287
Joined: Thu Oct 05, 2017 3:38 pm

Re: implement CRUD with MSImport

Post by Dev_Coppelis »

and i can't understand how to upload the code can you refer to which files should be removed from the snapshot that i provided before

User avatar
Dev_Coppelis
Premium Member
Premium Member
Posts: 287
Joined: Thu Oct 05, 2017 3:38 pm

Re: implement CRUD with MSImport

Post by Dev_Coppelis »

pmiklashevich wrote:Hm, interesting.. We will take a look! Thanks for bringing our attention to this problem! Will let you know as soon as it's fixed. (or 6.0.4 is out)
thanks so much for the quick response.
really i appreciate your efforts.

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 3070
Joined: Fri Apr 01, 2016 11:08 am

Re: implement CRUD with MSImport

Post by pmiklashevich »

Dev_Coppelis wrote:and i can't understand how to upload the code can you refer to which files should be removed from the snapshot that i provided before
Test case should be runnable, so we can unzip it, open in browser, and it should work with no errors. The archive shouldn't contain any libraries (ext, sch, gnt etc). We will include them by ourself and fix paths in index.html. Then we need some steps to run to be able to reproduce the issue.

To create a test case please take any of our examples as a base and change it with minimum code until you can reproduce the error. As soon the error is reproduced, please zip up the sample you've modified, and attache to the post here. We will check it and try to figure out the reason of the failure.

Before you attach the archive you can check it to make sure it's reproducible. To do that you need to unzip the archive and try to run it yourself.

I hope this guidance will help you.

Cheers,
Pavel Miklashevich - Core Developer

User avatar
Dev_Coppelis
Premium Member
Premium Member
Posts: 287
Joined: Thu Oct 05, 2017 3:38 pm

Re: implement CRUD with MSImport

Post by Dev_Coppelis »

but as an example:
if i added some code in crudmanager class and this generates error how can i explain this to you?

User avatar
mats
Core Developer
Core Developer
Posts: 16566
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

Re: implement CRUD with MSImport

Post by mats »

You simply give us a full test case, which we can run locally and debug.
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
Dev_Coppelis
Premium Member
Premium Member
Posts: 287
Joined: Thu Oct 05, 2017 3:38 pm

Re: implement CRUD with MSImport

Post by Dev_Coppelis »

pmiklashevich wrote:Also I've checked the code. The error happens in Sch.data.Calendar.convertMSDurationToUnit when it tries to read property DAY of this.unitsInMs.

Code: Select all

this.unitsInMs['DAY']
this.unitsInMs is null by default, but it's get filled with values in constructor. So need to debug to see why it's not filled up.
i found that the error is because of the calenders that returned back from back-end.
i removed this line form ganttCrudController in load function

Code: Select all

if (loadRequest.calendars != null) loadResponse.setCalendars(gantt.getCalendars(), 1);
then data are loaded successfully and i can make any changes.
but the sync function are not called
Ext Exception beforeSync.png
Ext Exception beforeSync.png (155.84 KiB) Viewed 2362 times
Ext Exception.png
Ext Exception.png (139.56 KiB) Viewed 2362 times

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 3070
Joined: Fri Apr 01, 2016 11:08 am

Re: implement CRUD with MSImport

Post by pmiklashevich »

It looks like now you have a recursion. Need to debug further on. Please try to figure out yourself, or prepare a test case so we can help you to look at this problem.
Pavel Miklashevich - Core Developer

User avatar
Dev_Coppelis
Premium Member
Premium Member
Posts: 287
Joined: Thu Oct 05, 2017 3:38 pm

Re: implement CRUD with MSImport

Post by Dev_Coppelis »

till now i can't understand how to send you a demo to test
but i will tell you the steps that i made

in MSProjectGantt :
1) i added the following line of code to enable crud operation with gantt.

Code: Select all

var crud = new Gnt.examples.msproject_import.crud.CrudManager({ taskStore : taskStore });
-- then tried it and it make load operation successfully.

in BryntumMPPReader project :
1) after importing .mpp file and has been parsed the returned json contains a task object and this object has my tasks as a children but this causes an error in mapping because my tasks's parentId is set to the object task so i returned just the childs ( my own tasks ) without its parent and this solved the issue.

now i tried to upload mpp file it gives me the error about can't read value day of null that explained earlier and the response was :
Also I've checked the code. The error happens in Sch.data.Calendar.convertMSDurationToUnit when it tries to read property DAY of this.unitsInMs.

Code: Select all

this.unitsInMs['DAY']
this.unitsInMs is null by default, but it's get filled with values in constructor. So need to debug to see why it's not filled up.
in GanttCrudController :
i removed the line that returns calendar data in load function

Code: Select all

//if (loadRequest.calendars != null) loadResponse.setCalendars(gantt.getCalendars(), 1);
and the error was gone.
but after doing all of that the data are imported successfully and saved to database but the only issue is if i double clicked on any task to make an edit but i didn't change its value the duration of the top parent task are changed from 151 to 183 days ( mpp file is attached ).
before trying to edit :
sync success.png
sync success.png (38.52 KiB) Viewed 2361 times
after trying to edit :
after edit trying.png
after edit trying.png (39.89 KiB) Viewed 2361 times
but to solve the recalculation that happened i made this change.
in MSImportPanel.js :
in success event handler i wrote this

Code: Select all

action.result.data.calendars = { children: action.result.data.calendars.children, metadata: action.result.data.calendars.metadata };
before firing dataavailable event.
but it thorws an exception which is :
Ext Exception.png
Ext Exception.png (18.45 KiB) Viewed 2361 times

I hope that every thing is clear now

User avatar
Dev_Coppelis
Premium Member
Premium Member
Posts: 287
Joined: Thu Oct 05, 2017 3:38 pm

Re: implement CRUD with MSImport

Post by Dev_Coppelis »

mpp file
VAOI-ANNEE1_V3.3 (3).rar
(23.74 KiB) Downloaded 75 times

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 3070
Joined: Fri Apr 01, 2016 11:08 am

Re: implement CRUD with MSImport

Post by pmiklashevich »

Please upload a fully runnable test case
Pavel Miklashevich - Core Developer

Post Reply