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.

Add controls at runtime

Thread ID:

Created:

Updated:

Platform:

Replies:

120889 Oct 25,2015 08:48 PM Oct 29,2015 01:12 AM JavaScript 3
loading
Tags: ejRibbon
Soporte Turyser
Asked On October 25, 2015 08:48 PM

Hello:

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.

Is there any way to do it?

Thanks for your time!

Juan Segura

Kavitha Narayanan [Syncfusion]
Replied On October 26, 2015 03:04 AM

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.




Soporte Turyser
Replied On October 27, 2015 06:48 PM

Great!

Thanks for your help!

Kavitha Narayanan [Syncfusion]
Replied On October 29, 2015 01:12 AM

Hi Soporte.

Please let us know if you have any other query.

Regards,
Kavitha N.


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.

;