This is a migrated thread and some comments may be shown as answers.

Change dynamicaly Image in ImageUrl

3 Answers 219 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Bruno
Top achievements
Rank 1
Bruno asked on 02 Jun 2014, 09:45 AM
Hello,
Is it possible to change dynamically the Image (in ImageUrl) in my Tabstip?
@( Html.Kendo().TabStrip()
        .Name("TabStripMaster")
        .Items(parent =>
        {
            parent.Add().Text("Description")
                .Selected(true)
                .ImageUrl("~/Content/Common/Icons/Description.png")
May I use JScript?
Regards,
Bruno

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 04 Jun 2014, 08:16 AM
Hi Bruno,

You can use the TabStrip client-side API to remove the needed tab, and add a new one with the desired settings:

Kind Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Bruno
Top achievements
Rank 1
answered on 09 Jun 2014, 02:52 PM
Thank you for your reply!
Yes you're right I can use the Tabstrip API but  when I use this method another problem appears.
I can't "insertAfter" or "appen" cshtml file correctly thanks to the contentUrl.
var tabStrip = $("#TabStripMaster").kendoTabStrip().data("kendoTabStrip");
        tabStrip.append(
            [{
                text: "_Validation",
                contentUrl: "../../FicheQualite/test"
            }],
            tabStrip.tabGroup.eq(0)
and my test.cshtml:
<table class="edit">
                    <!-- Ligne Responsable -->
                    <tr>
                        <th>Responsable</th>
                        <td>
/*Autocomplete*/
                                    @(Html.Kendo().AutoCompleteFor(model => model.Data.TrtResponsable)
                                    .Name("Data.TrtResponsable")
                                    .Placeholder("Choisisez un responsable...")
                                    .BindTo(Model.Utilisateurs.Select(model => model.eMail))
                                    .HtmlAttributes(new { style = string.Format("width:100%") })
                                    .Filter("contains")
                                    )
                                   @Html.ValidationMessageFor(model => model.Data.TrtResponsable)
                              </td>
</tr>
</table>
So as you can see on my print screen file joined the Kendo and cshtml functions are not visible....
0
Vladimir Iliev
Telerik team
answered on 11 Jun 2014, 11:16 AM
Hi Bruno,

Basically the "append" method doesn't support second parameter - that why you should use the "insertAfter" method instead. Also as second parameter you should pass the first tab in the collection instead of it's parent "ul" element - please check the updated code below:

tabStrip.insertAfter(
            [{
                text: "_Validation",
                contentUrl: "../../FicheQualite/test"
            }],
            tabStrip.tabGroup.children().eq(0))

Kind Regards,
Vladimir Iliev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TabStrip
Asked by
Bruno
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Bruno
Top achievements
Rank 1
Share this question
or