BoldDesk®Customer service software with ticketing, live chat & omnichannel support, starting at $99/mo for unlimited agents. Try for free!
Hi,
I have four questions with this ribbon.
1. Instead of assigning the splitButtonSettings values for the ribbon in html as is it possible to give it in JSON itself.
2. Assigning dropdown values at run time.
3. Enabling and disabling ribbon menus at run time
4. how to dynamically add tabs at run time.
5. how to add other controls in ribbon without adding jquery can we do this.
Ex:
Instead of giving Targetid and binding in html is it possible to construct it with in json itself
Will this ribbon JSON support Level 4 menus
[TS] onCreate(e){ var fontFamily = ["Segoe UI", "Arial", "Times New Roman", "Tahoma", "Helvetica"]; var DropDrownObj = $("#Default_fontfamily").ejDropDownList("instance"); DropDrownObj.option("dataSource",fontFamily); } |
[TS] onEnable(){ var menuObj = $("#ribbonmenu").ejMenu("instance"); menuObj.enable(); } onDisable(){ var menuObj = $("#ribbonmenu").ejMenu("instance"); menuObj.disable(); } |
[TS] onAddTab(){ var tabGroup = [{ text: "New", alignType: ej.Ribbon.AlignType.Rows, content: [{ groups: [ { id: "new", text: "New", toolTip: "New", buttonSettings: { contentType: ej.ContentType.ImageOnly, imagePosition: ej.ImagePosition.ImageTop, prefixIcon: "e-ribbon e-icon e-new" } } ], defaults: { type: ej.Ribbon.Type.Button, width: 60, height: 70 } }] }]; this.ribbon.widget.addTab("Tab2", tabGroup,3); } |
[TS] let ul:any; splitObj = [{ id: 1, text: "Item 1" }, { id: 2, text: "Item 2" }, { id: 3, text: "Item 3" }]; ul = document.createElement("ul"); ul.id = "pasteSplit"; //Split button Target Id document.body.appendChild(ul); debugger; for (let i = 0; i < splitObj.length; i++) { let li = document.createElement("li"); let a = document.createElement("a"); a.innerHTML = splitObj[i].text; li.appendChild(a); ul.appendChild(li); } |
[HTML] <ul id="ribbonmenu"> <li> <a>FILE</a> <ul> <li><a>New</a></li> <li><a>Open</a></li> <li><a>Save</a></li> <li><a>Save As</a></li> <li><a>Print</a></li> </ul> </li> </ul> [TS] // groups: [{ text: "Font", content: [{ groups: [{ id: "ribbonmenu", type: ej.Ribbon.type.custom, contentID: "ribbonmenu" }] }] }] //To use this method for after ejMenu component creation. //Enable onEnable(){ var menuObj = $("#ribbonmenu").ejMenu("instance"); menuObj.enable(); } //Disable onDisable(){ var menuObj = $("#ribbonmenu").ejMenu("instance"); menuObj.disable(); } |