Posted 3 May 2022, 8:43 pm EST
This is my code .```
config.ribbon[0].buttonGroups.unshift({
label: “Refresh Data”,
thumbnailClass: “”,
commandGroup: {
children: [
{
direction: “vertical”,
commands: [“cmdRfrh”],
},
],
},
});
config.ribbon[0].buttonGroups.unshift({
label: “Save Data”,
thumbnailClass: “”,
commandGroup: {
children: [
{
direction: “vertical”,
commands: [“cmdSaveData”],
},
],
},
});
config.ribbon[0].buttonGroups.unshift({
label: “Share”,
thumbnailClass: “”,
commandGroup: {
children: [
{
direction: “vertical”,
commands: [“cmdShareData”],
},
],
},
});
config.ribbon[0].buttonGroups.unshift({
label: “UserEmail”,
thumbnailClass: “”,
commandGroup: {
children: [
{
direction: “horizontal”,
commands: [“cmdUserList”],
},
],
},
});
config.ribbon[0].buttonGroups.unshift({
label: “Welcome”,
thumbnailClass: “welcome”,
commandGroup: {
children: [
{
direction: “vertical”,
commands: [“Welcome”],
},
{
direction: “vertical”,
commands: [“wel2”],
},
],
},
});
config.commandMap = {
Welcome: {
title: “Welcome”,
text: “Welcome”,
iconClass: “ribbon-button-welcome”,
bigButton: “true”,
commandName: “Welcome”,
execute: async (context, propertyName, fontItalicChecked) => {
alert("Welcome to new designer " + userName);
},
},
cmdRfrh: {
title: “refresh data from server”,
text: “Refresh”,
iconClass: “cmdRfrh”,
bigButton: “true”,
commandName: “cmdRfrh”,
execute: async (context, propertyName, fontItalicChecked) => {
refershData(ref, fileData);
},
},
cmdSaveData: {
title: “Save data to server”,
text: “Save”,
iconClass: “cmdSaveData”,
bigButton: “true”,
commandName: “cmdSaveData”,
execute: async (context, propertyName, fontItalicChecked) => {
saveToDB(ref);
},
enableContext: permission,
},
cmdUserList: {
title: “list of users”,
text: UserEmail + “\n” + UserEmail,
style: “”,
bigButton: “true”,
commandName: “cmdUserList”,
execute: async (context, propertyName, fontItalicChecked) => {
console.log(UserEmail);
},
},
cmdShareData: {
title: “Share”,
text: “Share”,
bigButton: “true”,
commandName: “cmdShareData”,
execute: async (context, propertyName, fontItalicChecked) => {
setModalShow(true);
},
},
};