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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Set ImageCssClass to new tabs by javascript

Thread ID:

Created:

Updated:

Platform:

Replies:

121143 Nov 13,2015 02:43 PM UTC Nov 16,2015 03:01 PM UTC ASP.NET Web Forms 1
loading
Tags: Tab
Jorge Pampin
Asked On November 13, 2015 02:43 PM UTC

Hello,

How to set the ImageCssClass property to the new tabs when I create the tabs by javascript?

Thanks!

Ragunath M [Syncfusion]
Replied On November 16, 2015 03:01 PM UTC

Hi Jorge

Thank you  for contacting Syncfusion support.

There is no  property name called ImageCssClass in our Tab. To set image to newly added tab through the javascript, we suggest you the following work around,

<code>

  <script type="text/javascript">

        $(function () {

            // declaration

            $("#defaultTab").ejTab();

            $("#btn").ejButton({ click: "onclick" });

        });

        function onclick() {

            var obj = $("#defaultTab").data("ejTab");

            obj.addItem("#new", "New Item", 3);

            $(obj.items[3]).append("<span class='myClass'></span>")

        }

    </script>

    <style type="text/css" class="cssStyles">

        .myClass {

            background-image: url("../images/rating/mos.png");

            width: 30px;

            height: 25px;

            float: left;

        }
    </style>
</code>

Regards
Ragunath M


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.

Warning Icon 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.Close Icon

;