Hi Juan Segura,
Thanks for using Syncfusion products.
Query: I want to add tabs at runtime in a JavaScrpit Ribbon. I know that I can create at start and Hide and show, but I need to créate after the ribbon has been created.
We use addTab() method to add tab at runtime in the ribbon control in which new tab will be added while clicking the button.
[Code]
<div id="Ribbon"></div>
<input type="button" value="Click to add new Tab" id="btn" onclick="btnclick(this)">
<Script>
$(function () {
$("#Ribbon").ejRibbon({
// Set the width during initialization.
width: "700px"
});
});
function btnclick(e)
{
var tabGroup = [{
text: "New1", alignType: ej.Ribbon.alignType.rows, content: [{
groups: [{ //display in ribbon tab
id: "new1",
text: "New Tab2",
}
],
defaults: {
type: ej.Ribbon.type.button,
width: 60,
height: 70
}
}]
}];
var ribbonObj = $("#Ribbon").data("ejRibbon");
ribbonObj.addTab("Tab2", tabGroup, 2);//New tab will be added while clicking the button
}
For your reference, we have attached a sample and UG link.
Sample: http://www.syncfusion.com/downloads/support/forum/120889/ze/Sample1177970511.zip
UG Link: http://help.syncfusion.com/js/api/ejribbon#methods:addtab
Regards,
Kavitha N.