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

Passing ObservableArray to TabStrip.append

2 Answers 88 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Sunny
Top achievements
Rank 1
Sunny asked on 24 Dec 2014, 06:54 PM
​When creating tabs within TabStrip, I can pass in an array of objects with Tab information to $el.kendoTapStrip().data('KendoTabStrip').append() function, and it works fine.

But if the tab information is in a kendo.data.ObservableArray (which all arrays within a kendo.observable object get transformed to), then it fails the "array check" within the _create function of Kendo, and consequently tries to get evaluated as a DOM element.

In 2014.4.1119 the line currently is "if (plain || $.isArray(tab)) {", maybe could be expanded to include this counterpart to read:  "if (plain || $.isArray(tab) || tab instanceof kendo.data.ObservableArray) {", or something to that nature.

Thanks!

2 Answers, 1 is accepted

Sort by
0
Sunny
Top achievements
Rank 1
answered on 24 Dec 2014, 07:03 PM
Also, the next line would be changed from "tab = $.isArray(tab) ? tab : [tab];" to "tab = !plain ? tab : [tab];"
0
Alex Gyoshev
Telerik team
answered on 25 Dec 2014, 09:54 AM
Hello Sunny,

Thank you for reporting this. It has been logged in the Kendo UI Core repository. As a workaround, you can call the ObservableArray toJSON method when passing it to the append method.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TabStrip
Asked by
Sunny
Top achievements
Rank 1
Answers by
Sunny
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or