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.
Unfortunately, activation email could not send to your email. Please try again.

How can I custom this alert?

Thread ID:

Created:

Updated:

Platform:

Replies:

130904 Jun 9,2017 06:18 AM Jun 15,2017 08:38 AM JavaScript 3
loading
Tags: ejGrid
Luis Carlos
Asked On June 9, 2017 06:18 AM

Hi.

When I clic on edit button without any selected row.



The component Grid show this message (as shown in the image below) by default. I was wondering if I can show this message in a custom way.


I will be awating four your reply, thank you in advance.

Best regards,
Luis Carlos Díaz.

Venkatesh Ayothi Raman [Syncfusion]
Replied On June 12, 2017 03:03 AM

Hi Luis, 

Thanks for contacting Syncfusion support. 

We have achieved your requirement by customizing the locale property like as follows, 

Code example
$("#Grid").ejGrid({ 
            // the datasource "window.gridData" is referred from jsondata.min.js 
            dataSource: window.gridData, 
            columns: [ 
                . . . 
            ] 
        }); 
 
        //customize the default locale property 
        ej.Grid.Locale["en-US"] = { 
         
            DeleteOperationAlert: "Here you can customize the text for delete button", 
            EditOperationAlert: "Here you can customize the text for edit button", 
       
        }; 

Note: in above code example, we have used the default locale. So, you can change the locale value for your corresponding locale. 
We have also prepared a sample based on your requirement which can be referred from following link, 

Please refer to the following Help documentation for change the other Grid locale text, 
  

Regards, 
Venkatesh Ayothiraman. 


Luis Carlos
Replied On June 14, 2017 08:56 AM

Hi Luis, 

Thanks for contacting Syncfusion support. 

We have achieved your requirement by customizing the locale property like as follows, 

Code example
$("#Grid").ejGrid({ 
            // the datasource "window.gridData" is referred from jsondata.min.js 
            dataSource: window.gridData, 
            columns: [ 
                . . . 
            ] 
        }); 
 
        //customize the default locale property 
        ej.Grid.Locale["en-US"] = { 
         
            DeleteOperationAlert: "Here you can customize the text for delete button", 
            EditOperationAlert: "Here you can customize the text for edit button", 
       
        }; 

Note: in above code example, we have used the default locale. So, you can change the locale value for your corresponding locale. 
We have also prepared a sample based on your requirement which can be referred from following link, 

Please refer to the following Help documentation for change the other Grid locale text, 
  

Regards, 
Venkatesh Ayothiraman. 


Maybe I did not explain well.

I would like to change the way of this message, not the message.

For instance, I use a custom method to show message ("showAlertDialog()"). So I would like to use my own method instance of your method ("alert()").

Is it possible?

I hope you may understand my query, thank you in advance.

Best regards,
Luis Carlos.

Venkatesh Ayothi Raman [Syncfusion]
Replied On June 15, 2017 08:38 AM

Hi Luis, 

Thanks for the update. 

We have achieved your requirement using toolbarClick event in Grid. In this event, we have prevent the default alert windows. Please refer to the following code example and screenshot, 
Code example
$("#Grid").ejGrid({ 
                // the datasource "window.gridData" is referred from jsondata.min.js 
                dataSource: window.gridData, 
                allowPaging: true, 
                . . . 
 
                toolbarClick: function (args) { 
                 
                    if ((args.itemName == "Edit" || args.itemName == "Delete") & this.getSelectedRecords().length == 0) { 
 
                        alert = function () { }; //prevent the default alert popup 
                        
                        //here you can call your own customize alert method 
                    } 
                }, 
                columns: [ 
                        . . . 
                ] 
            }); 
 

we have prepared a sample for your convenience which can be referred from following link, 

Regards, 
Venkatesh Ayothiraman. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;