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

Tabstrip title using datasource and template or string concatenation

3 Answers 228 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 2
Steve asked on 16 May 2012, 06:49 AM
In a tabstrip bound to a datasource, is there any way to specify a template for the text that displays on the tab or concatenate a string value along with the field bound to dataTextField?  For example, if I have datasource containing a column called "TeamName" containing  the values "Red", "Blue", and "Green", is there any way to concatenate a string such as " Team" so that the tab text actually displays the concatenated values of "Red Team", "Blue Team", "Green Team"?

Any assistance is appreciated; I'm happy to provide further clarification or sample code if needed.

3 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 18 May 2012, 06:33 PM
Hello Steven,

Generally speaking, a template functionality on the tabs in the Kendo UI TabStrip is not supported out of the box. As a workaround I suggest to modify the incoming data in the data function. For example:
$("#tabStrip").kendoTabStrip({
   dataTextField: "TeamName",
   dataContentField: "content",
   dataSource: {
   data: data,
   schema: {
     data: function(data) {
        for(var i = 0; i < data.length; i++) {
           data[i].TeamName = "Team Name :: " + data[i].TeamName;
        }
    return data;
     }
   }
  }
});
For convenience, I created a sample project, which illustrates such approach in action. 

 

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Steve
Top achievements
Rank 2
answered on 25 May 2012, 02:58 PM
Hi Iliana,

Sorry for the delay in replying; I think my spam filter must have blocked the notification of your response.

Thanks for the feedback; I'll go ahead and add the concatenated string through the data function then.  Are there any plans to add support for templates in a future release, or do you expect this to continue to be the recommended approach for the foreseeable future? 

Regards,
Steve 
0
Iliana Dyankova
Telerik team
answered on 28 May 2012, 05:10 PM
Hi Steve,

The implementation of templates in the tabs of Kendo UI TabStrip is not scheduled, but this idea sounds good and I would suggest to share it as a feature request at our UserVoice page. This way the community would be able to vote it and if this suggestion turns out to be popular we will consider its implementation.

 

Kind regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TabStrip
Asked by
Steve
Top achievements
Rank 2
Answers by
Iliana Dyankova
Telerik team
Steve
Top achievements
Rank 2
Share this question
or