Christopher Dembek
03/25/2021, 3:37 PMSteve Goldberg
03/25/2021, 3:47 PMThis is because the layout component does not ‘own’ this parent view. Using the code in this second example will result in the following console warning:This refers to specific scenarios where you try to use verbose syntax with the layout container that are not in its child view chain
Christopher Dembek
03/25/2021, 3:47 PMSteve Goldberg
03/25/2021, 3:47 PMSteve Goldberg
03/25/2021, 3:48 PMChristopher Dembek
03/25/2021, 3:50 PMINVALID_PARAM Invoking the method "addChildViews" with an incorrect parameter: (Header.View).
It will still work but it will be deprecated in the future. Please check the documentation.
Christopher Dembek
03/25/2021, 3:52 PMvar layout = container.getComponent('Layout');
layout.addChildViews('Home.View', {
'HomeSlider': {
'HomeSlider.View': {
childViewIndex: 1,
childViewConstructor: function HomeSlider() {
return new HomeSliderView({
environment: environment
});
}
}
}
});
Steve Goldberg
03/25/2021, 4:04 PMChristopher Dembek
03/25/2021, 4:06 PMChristopher Dembek
03/25/2021, 4:09 PMSteve Goldberg
03/25/2021, 4:20 PMAlso the HomeSlider.View has been updated to SCViewNot sure that's relevant.
So the warning is a SCS bug?Hard to say. It makes sense for all the other visual components but not for layout, as one would never add a child view to Backbone.View directly. Equally, how would we expect developers to use addChildViews() with Home.View and Header.View etc?
Christopher Dembek
03/25/2021, 4:31 PMvar layout = container.getComponent('Layout'),
environment = container.getComponent('Environment')
layout.addChildViews('Home.View', {
'HomeSlider': {
'HomeSlider.View': {
childViewIndex: 1,
childViewConstructor: function intHomeSlider() {
return new HomeSliderView({
environment: environment
});
}
}
}
});
Steve Goldberg
03/25/2021, 4:35 PMSteve Goldberg
03/25/2021, 4:36 PMChristopher Dembek
03/25/2021, 4:37 PMChristopher Dembek
03/25/2021, 5:25 PMvar layout = container.getComponent('Layout'),
environment = container.getComponent('Environment')
layout.addChildViews(
layout.ALL_VIEWS, {
'HomeSlider': {
'Home.View': {
childViewIndex: 1,
childViewConstructor: function intHomeSlider() {
return new HomeSliderView({
environment: environment
});
}
}
}
});
Steve Goldberg
03/25/2021, 5:27 PMSteve Goldberg
03/25/2021, 5:28 PMSteve Goldberg
03/25/2021, 5:28 PM