Change dynamicaly Image in ImageUrl

4 posts, 0 answers
  1. Bruno
    Bruno avatar
    5 posts
    Member since:
    Jan 2013

    Posted 02 Jun 2014 Link to this post

    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
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 04 Jun 2014 Link to this post

    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.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Bruno
    Bruno avatar
    5 posts
    Member since:
    Jan 2013

    Posted 09 Jun 2014 in reply to Vladimir Iliev Link to this post

    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....
  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 11 Jun 2014 Link to this post

    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.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready