Individualize DeleteConfirmDialog

Hello,

trying to individualize SF-DataGrids Delete confirm dialog I use these two Javascript functions I found in one of Your examples:

 

        function beforeOpen(args) {

            var gridobj = $("#ProduktauswahlGrid").data("ejGrid");

            var data = gridobj.model.currentViewData[gridobj.model.selectedRowIndex];  // get the details of the selected record

            $("#" + this.element.attr("id")).find(".details").remove();

            $("#" + this.element.attr("id")).prepend("Sind Sie sicher, dass Sie die Produktauswahl '" + data.Bezeichnung + "' löschen wollen?");

        }

        function dataBound(args) {

            $("#" + this.element.attr("id") + "ConfirmDialog_wrapper").prepend("Löschen bestätigen");

            $("#" + this.element.attr("id") + "ConfirmDialog").ejDialog({

                beforeOpen: "beforeOpen" // bind the function beforeOpen to the beforeOpen event of the ejDialog

            });

        }

 

Unfortunately my individual confirm dialog text appears ADDITIONALLY in front oft he standard text:




Things get even worse when I call the delete a second, third, …. Time - every new individual confirm dialog text is prepended additionally:







Can You please tell me what’s going wrong here?


Thank You

Best Regards

Anis Helaoui



4 Replies

KM Kuralarasan Muthusamy Syncfusion Team February 21, 2018 02:14 PM UTC

Hi Anis, 

We have analyzed your query and we found that you want to delete dialog with some additional dialogs. So we take that additional dialog into the div element for add and remove purpose.  

Please refer the following code snippet : 
<script> 
    function beforeOpen(args) { 
             
          ............ 
 
            this.element.find("div.customconten").remove(); 
 
            var elem = ej.buildTag("div.customconten", "Sind Sie sicher, dass Sie die Produktauswahl '" + data. Bezeichnung + "' löschen wollen?"); 
 
            this.element.prepend(elem); 
    } 
    function dataBound(args) { 
 
         ........         
 
    } 
</script> 


If you need further assistance please get back to us, 

Regards, 
Kuralarasan M. 



AH Anis Helaui February 21, 2018 04:29 PM UTC

Hello Kuralarasan,
I want to delete the default message from the delete dialog and replace it with an individual message.
With the function "this.element.find("div.customconten").remove(); " will not remove the Default message.
We want edit the Default message in dev.e-content. If we edit it with the function this.element.find("div.e-content").remove(), then the "cancel" button will not longer work and i recieve the following:
  
 ej.web.all.min.js:10 Uncaught TypeError: Cannot read property 'requestType' of undefined
    at Object._triggerConfirm (ej.web.all.min.js:10)
    at Object.f (jquery-2.2.0.min.js:2)
    at Object._trigger (ej.web.all.min.js:10)
    at Object._btnMouseClickEvent (ej.web.all.min.js:10)
    at HTMLInputElement. (ej.web.all.min.js:10)
    at HTMLInputElement.dispatch (jquery-2.2.0.min.js:3)
    at HTMLInputElement.r.handle (jquery-2.2.0.min.js:3)
_triggerConfirm @ ej.web.all.min.js:10
f @ jquery-2.2.0.min.js:2
_trigger @ ej.web.all.min.js:10
_btnMouseClickEvent @ ej.web.all.min.js:10
(anonymous) @ ej.web.all.min.js:10
dispatch @ jquery-2.2.0.min.js:3
r.handle @ jquery-2.2.0.min.js:3


Thank you
Regards
Anis Helaoui
 


KM Kuralarasan Muthusamy Syncfusion Team February 22, 2018 11:57 AM UTC

Hi Anis, 

We have achieved your requirement by using CssClass property. We couldn’t replace the e-content text.  Suppose you will replace or remove that text it will show some error. So we suggest CssClass property. 

Please refer the following code example: 
@(Html.EJ().Grid<EmployeeView>("sGrid") 
                   .............. 
 
                        .CssClass("deleteDialog") 
                   .............. 
) 
<style type="text/css"> 
    .e-grid.deleteDialog div[id*='ConfirmDialog'] > div.e-content { 
        display: none; 
    } 
    </style> 

Please refer the following link to know about CssClass property: https://help.syncfusion.com/api/js/ejgrid#members:cssclass 

If you need further assistance please get back to us, 

Regards, 
Kuralarasan. 




AP Ashwini Paranthaman Syncfusion Team February 23, 2018 04:41 AM UTC

From: Helaoui, Anis  
Sent: Thursday, February 22, 2018 8:50 AM
To: Syncfusion Support
 
Subject: AW: Syncfusion support community forum 136009, Individualize DeleteConfirmDialog, has been updated. 

Hallo Walter, 
zur Info. 
Gruß 
Anis 


Loader.
Up arrow icon