Hi, we have a subclass of TabStrip and would like to set its default animation property to false. It seemed logical to simply override the options object with that setting -- but this causes an error as soon as you try to change tabs:
http://jsfiddle.net/nwVtr/
The error is because the TabStrip widget initializes the animation properties from the options parameter in the constructor before it has merged them with the default options of the widget. This happens on line 33128 of kendo.web.js (v2012.2.710).
In _animations() there is a check for animations:false, where it creates an empty animations object that simply does a show/hide. But since the widget is using the empty options parameters without merging them with the widget's default options, there is no animations:false and this default "no animations" object never gets created.
So then, when the tab is clicked, in activateTab() the 'effects' property of the animation object is accessed, which causes the error because the default "false" animation object never got created (line 33979):
It would seem to me that the options parameter should be merged with the default options before _animations() is called, so that the animations object gets set up properly. Is this a Kendo bug, or am I approaching this the wrong way? Thanks!
ryan
p.s. Note the commented section of my JSFiddle; this workaround solves the issue but is definitely not as clean as simply overriding the option, as we are attempting to do. Alternatively, I could initialize the widget's default animation property to the object that gets set inside _animations(), but that is not ideal either because it depends on undocumented internals and not the published widget API.
http://jsfiddle.net/nwVtr/
The error is because the TabStrip widget initializes the animation properties from the options parameter in the constructor before it has merged them with the default options of the widget. This happens on line 33128 of kendo.web.js (v2012.2.710).
that._animations(options);
In _animations() there is a check for animations:false, where it creates an empty animations object that simply does a show/hide. But since the widget is using the empty options parameters without merging them with the widget's default options, there is no animations:false and this default "no animations" object never gets created.
So then, when the tab is clicked, in activateTab() the 'effects' property of the animation object is accessed, which causes the error because the default "false" animation object never got created (line 33979):
if (kendo.size(animation.effects)) {
It would seem to me that the options parameter should be merged with the default options before _animations() is called, so that the animations object gets set up properly. Is this a Kendo bug, or am I approaching this the wrong way? Thanks!
ryan
p.s. Note the commented section of my JSFiddle; this workaround solves the issue but is definitely not as clean as simply overriding the option, as we are attempting to do. Alternatively, I could initialize the widget's default animation property to the object that gets set inside _animations(), but that is not ideal either because it depends on undocumented internals and not the published widget API.