| Page 1 of 1 | [ 5 posts ] |
|
Hello,
I was testing out the YUI View component Code: Y.PieView = Y.Base.create('pieView', Y.View, [], { and I ran into an issue. It seems that if I create a new div node in the container ATTR with an id, then when I try to get the container instance in the view's render(), then the id is no longer there... }, { // Specify attributes and static properties for your View here. ATTRS: { // Override the default container attribute. container: { valueFn: function () { return Y.Node.create('<div id="pie"/>'); } } } }); Code: this.get('container').get('id') // is empty string Anyone else notice this?Thanks |
|
I'm using YUI 3.5pr4
|
|
Can you point me to an example that reproduces this problem?
I tried out the code you have here and it worked correctly for me: http://jsfiddle.net/ericf/SrLcW/ |
|
Hi Eric,
Thanks for the quick response! False alarm. I thought it was a bug possibly due to using a YUI View in a YUI custom module, but it is not. I'm trying out TDD and turns out I was initializing the view in the setup() of my test case with a config object Code: Y.myCustomViewModule({ So even though I redefined the container inside the View class definition, the container was getting overridden by the container selector defined in the config object at construction! Once, I got rid of that it all works.container: '#someSelectorThatDoesNotExist' }); Now that I think of it, I guess I took one too many leaps and not enough baby steps w/ TDD Thanks for the support! |
|
Oh good. That makes more sense that it wasn't working as expected because it was being overridden at the instance level.
|
| Page 1 of 1 | [ 5 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group