How can I custom this alert?
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.
SIGN IN To post a reply.
3 Replies
VA
Venkatesh Ayothi Raman
Syncfusion Team
June 12, 2017 07:03 AM UTC
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.
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.jsdataSource: window.gridData,columns: [. . .]});//customize the default locale propertyej.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.
VA
Venkatesh Ayothi Raman
Syncfusion Team
June 15, 2017 12:38 PM UTC
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: [
. . .
]
});
|
Help documentation: https://help.syncfusion.com/api/js/ejgrid#events:toolbarclick
we have prepared a sample for your convenience which can be referred from following link,
Regards,
Venkatesh Ayothiraman.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
LC Luis Carlos
- Jun 9, 2017 10:18 AM UTC
- Jun 15, 2017 12:38 PM UTC