We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Delete Conformation

Hi,

is there in Gantt any option to ask for conformation before delete, just like there is showDeleteConfirmDialog for Grid?

I have also trying to do following, but it didn't work:
public actionComplete(args) {
const type = args.requestType;
switch (type) {
case "delete":
if (confirm("Delete?") == true) {
let id = args.data.taskId;
this.taskService.delete(id);
} else {
args.cancel = true;
args.preventDefault();
args.stopImmediatePropagation();
args.isDefaultPrevented();
}
break;

So is there any quick solution?

I will be grateful for any help you can provide.
Marko

6 Replies

JD Jayakumar Duraisamy Syncfusion Team July 26, 2017 10:16 AM UTC

Hi Marko,  
At present, we don’t have “showDeleteConfirmDialog” support in Gantt. Hence, we have logged feature report as “Support for show delete confirm dialog in Gantt”.   
This feature will be implement and include in our upcoming Volume 1, 2018 main release.   
Please let us know, if you require any other assistance.  
Regards,  
Jayakumar D  



MA Marko July 30, 2017 01:41 PM UTC

Hi,

thank you for your answer.  So if there is no such option yet, is it posible to disable only keyboard delete button, so that when someone press delete on keyboard nothing would happened, but all other keyboard buttons would still work the same?

I hope what I have requested is possible.

Marko



JD Jayakumar Duraisamy Syncfusion Team July 31, 2017 01:23 PM UTC

Hi Marko, 
We can disable the delete key alone in Gantt control by remove the “deleteRecord” property in “keyConfig” object of TreeGrid and GantChart model. 
We can achieve this by using create event, please refer following code snippet, 
[HTML] 
 
<ej-gantt id="GanttControl" (create) = "ganttCreate($event)" 
> 
[TS] 
ganttCreate(args) { 
//TreeGrid Obj 
   var treeObj = $("#ejTreeGridGanttControl").ejTreeGrid("instance"),        
 
// GanttChart Object 
ganttchartObj = $("#ejGanttChartGanttControl").ejGanttChart("instance"); 
 
         delete treeObj.model.keyConfigs.deleteRecord; 
         delete ganttchartObj.model.keyConfigs.deleteRecord; 
        } 
We have also prepared a sample for your reference. Please find the sample location as below, 
Please let us know, if you require any other assistance on this. 
Regards, 
Jayakumar D 



MA Marko February 26, 2018 11:26 AM UTC

Hi,

since delete conformation has been added to Gantt, I wonder how to localize it? I searched in documentation, but I culd not found solution: https://help.syncfusion.com/js/gantt/localization

I would like to translate "Are you sure you want to delete record?" to another language. Do I have to localize Grid to translate this, or else how to do it?

Regards.
Marko


PE Punniyamoorthi Elangovan Syncfusion Team February 27, 2018 12:59 PM UTC

Hi Marko, 
There is no support for localizing the delete confirmation dialog text in Gantt. We have considered this as an issue and we have logged an issue report regarding this. This support will be implemented and will be included in our upcoming 2018 volume 1 service pack 1 release, which is expected to release by the end of March 2018. 
But currently we can achieve this using the below work-around with “load” client side event. Please find the code snippet below. 
 
create() { 
      let proxy = $('#GanttControl').ejGantt('instance'); 
      $("#ejTreeGridGanttControl_ConfirmDialog").find("div")[0].innerHTML = "هل تريد بالتأكيد حذف هذا العمود؟"; 
  }; 
 
 
We have prepared a sample for this, please find the link below. 
 
Regards, 
Punniyamoorthi 



MM Manikandan Manikam Syncfusion Team March 2, 2018 10:36 AM UTC

Hi Marko,  
Sorry for the inconveniences caused. 
In Gantt, the UI elements can be localized using the locale property, for this we have to refer corresponding culture file and locale text file and these files can be obtained by installing “syncfusion-ej-global” package. And you can get all the available locale text files and culture files by using  “syncfusion-ej-global-all” package. Please refer the following code snippets to apply localization for Gantt control. 

[package.json] 
//… 
"syncfusion-ej-global": "^15.3.26",  

[HTML] 
<ej-gantt id="GanttControl" [dataSource]="ganttData" locale= "fr-FR" 
            sizeSettings.height="350px" sizeSettings.width="70%" (create)="create()"> 
</ej-gantt> 

[TS] 
import 'syncfusion-ej-global/i18n/ej.culture.fr-FR.min.js'; 
import 'syncfusion-ej-global/l10n/ej.localetexts.fr-FR.min.js'; 
//… 


We have prepared a sample  with French culture, please find the sample location below. 

And also this locale text values can be modified in sample level, the below code snippets shows how to override the value of locale text for corresponding property. 

[TS] 
export class AppComponent { 
    //… 
    constructor() { 
        ej.TreeGrid.Locale['fr-FR'].deleteRecordText = 'Your Customized Text'; 
//… 


Please refer the following links to know more localization in Gantt. 

Please let us know if you require further assistance on this. 

Thanks, 
Manikandan M. 


Loader.
Up arrow icon