Gantt working with Redux (Ngrx) exemple

Hi

do you haven an example of Gantt working with Redux (Ngrx) ( synchronize data between gantt data and state,update , add , delete ,...etc )? it will be very helpfull.

Thanks,


6 Replies

AK Alagumeena Kalaiselvan Syncfusion Team February 4, 2022 01:41 PM UTC

Hi Mahdoui , 
 
We need some time to analyze your requirement and will share further details within two business days on 8th February 2022. Until then we appreciate your patience. 
 
Regards, 
Premkumar S 



PP Pooja Priya Krishna Moorthy Syncfusion Team February 8, 2022 04:13 AM UTC

Hi Mahdoui, 
  
We have logged a custom sample for your requirement. The sample will be provided on 11th February 2022. We appreciate your patience until then. 
  
Regards, 
Premkumar S 



MH Mahdoui Hafedh February 12, 2022 07:45 AM UTC

Hi Syncfusion Team,

any update aboute NGRX sample?

Best regards, 



MS Monisha Sivanthilingam Syncfusion Team February 14, 2022 08:40 AM UTC

Hi Mahdoui, 
 
Thank you for your patience!!! 
 
We have prepared a sample of Gantt working in Redux. We have performed CRUD operations in actionComplete event . 
 
 
The actionComplete event is triggered to update the Gantt data. You can perform the save operation based on the event arguments and you need to call the endEdit method to indicate the completion of the save operation. We have shared the code snippets of actionComplete event. Click on the link to get more information about actionComplete and endEdit   events . 
 
appComponent.ts 
 
public actionComplete(args: any) { 
    if (args.requestType == "save") { 
      this.TaskService.updateRecord(this.tasks).subscribe(() => { 
        args.endEdit(); 
    }, (e) => { 
        this.ganttChart.endEdit(); 
    } 
    ); 
  } 
    if (args.requestType == 'add') { 
      this.TaskService.addRecord(this.tasks).subscribe(() => { 
        args.endEdit(); 
      }); 
      this.TaskService.addRecord(this.tasks).subscribe(() => { }, error => console.log(error), () => { 
        args.endEdit(); 
      }); 
    } 
    if (args.requestType == 'delete') { 
      this.TaskService.deleteRecord(this.tasks).subscribe(() => { 
        args.endEdit(); 
      }); 
    } 
  } 
 
 
 
We have defined the functions such as add, delete,update in task-store.service.ts file. Please refer below sample for more information. 
 
addRecord(state: any): Observable<any> {// you can apply empty string instead of state.data to get failure(error) 
    return this.http.post<TaskModel>(this.apiUrl, state.data, httpOptions); 
  } 
  /** DELETE: delete the record from the server */ 
  deleteRecord(state: any): Observable<any> { 
    const id = state.data[0].id; 
    const url = `${this.apiUrl}/${id}`; 
    return this.http.delete<TaskModel>(url, httpOptions); 
  } 
  /** PUT: update the record on the server */ 
  updateRecord(state: any): Observable<any> { 
    return this.http.put(this.apiUrl, state.data, httpOptions); 
  } 
 
Please contact us for further assistance. 
 
 
Regards, 
Premkumar S 




MH Mahdoui Hafedh replied to Monisha Sivanthilingam February 15, 2022 08:02 PM UTC

Hi  Monisha,

at first, i would to thank you for your help and support,I tried to integrate your proposed solution but i found it is not serve NgRX purpose that i want to use , i'm confusion if you understand the NgRX that i mean and i'm sorry if i didn't explain it clearly.

so i want to use NgRx for State Management third librerie for Angular

is possible to use it with  ej2-Gantt ? like i mention in this ticket (https://www.syncfusion.com/forums/172586/cannot-read-properties-of-undefined-reading-ganttproperties ) i tried to implement it but an error appear.

Thanks,



MS Monisha Sivanthilingam Syncfusion Team February 17, 2022 06:15 AM UTC

Hi Mahdoui , 
 
We regret to say that we do not have support for performing CRUD operations in observables. We have logged a feature request for this and we will implement this in any of our upcoming releases. You can track the status of the feature request from the below feedback link. 
 
 
However, we do not have any immediate plan to implement this feature. At the planning stage for every release cycle, we review all open features and implement the features based on feature rank, customer requested count and volume wish-list. 
 
Regards, 
Premkumar S 


Loader.
Up arrow icon