This support forum belongs to the YUI3-Treeview Gallery Module.
| Page 1 of 1 | [ 6 posts ] |
|
I am starting to work with 3.3pr2 to take advantage of some of the latest and greatest. First time I have tried to include a gallery module and run from local, having some issues. Navigating the proper config examples that are in other posts has been quite hairy so far.
I noticed the post where it was mentioned to refer to the examples on github until the CDN was updated for proper config/inclusion, in looking at the object example I started with the following: YUI({ modules: { "gallery-yui3treeview": { fullpath : "../../../../yui3-gallery/build/gallery-yui3treeview/gallery-yui3treeview.js", requires : ["substitute", "widget", "widget-parent", "widget-child","node-focusmanager"] } }, filter:"raw", combine : false }) From other posts from people trying to get gallery and YUI2 widgets/modules running locally they have a gallery group defined. Here I see the use of the modules attribute. In trying both, the groups one seems to be ignored for trying to set a local base uri, but setting base under the modules.galler-yui3treeview worked to get proper base. The path came out to <my base>/gallery-yui3treeview/gallery-yui3treeview-min.js Just to test to see if things were working I took the TreeView.js file contents from github and created the -min.js file. I am still getting the following errors: Y is not defined [Break On This Error] var getClassName = Y.ClassNameManager.getClassName, galler...-min.js (line 1) Y.TreeView is not a constructor [Break On This Error] label : "level1-2" Is my config causing all the issues here, or is it also something to do with my general usage of the treeview mod? |
|
Nate:
I'm guessing that some of the assets are not being loaded, and that's why you're getting those errors. I guess I should change the examples in the example folder to use the actual CDN build, rather than the build version on the repo. Change your YUI use statement to this: YUI({ //Last Gallery Build of this module gallery: 'gallery-2011.01.03-18-30' }).use('gallery-yui3treeview', function(Y) { var treeview = new Y.TreeView({ srcNode: '#mytree', contentBox: null, type: "TreeView", children: [ { label: "level1-1", type: "TreeView", children: [ {label: "level2-1"}, {label: "level2-2"} ] }, { type: "TreeView", label : "level1-2" } ] }); treeview.render(); }); That's the proper way to actually load treeview. Thanks!! |
|
Thanks for the reply Gonzalo,
Gave your snippet a test run, I get this erron on my end now in firebug: TypeError: this.groups.gallery.update is not a function this.groups.gallery.update(val); It happens on line 792 in loader.js Seems like the snippet you gave me is meant to pull from the CDN, correct? I have to run all of my base and gallery files locally from the same server the app is getting served from |
|
Nate:
I posted an example here: http://goonieiam.com/treeview/treefromobject.html It's using the gallery conf object. So take a look and let me know if that helps thanks! |
|
Hey Gonzalo,
Your example helps from a general usage standpoint. The issue I am running into is serving the treeview gallery module from my local server, not from the CDN, the app I am building requires this. In your example you are pulling YUI base and the gallery from the CDN, and things work fine that way. The error in my initial post is what I get when I downloaded the gallery treeview file to my server and changes the YUI Config to pull that file: ------------------------------------ Y is not defined var getClassName = Y.ClassNameManager.getClassName,galler...-min.js (line 1) Y.TreeView is not a constructor label : "level1-2" ----------------------------------- In looking at the file contents for treeview, looks like the Y instance is just hanging out in the open, so when its included Y hasnt been defined in the files contents. Dont know if the CDN pulls do something to wrap during combo stage So to generalize the issue, if you wanted to run your http://goonieiam.com/treeview/treefromobject.html example from your local machine, serving all the YUI base/gallery js files to make the treeview work, what would the config and setup look like? |
|
The post is old, however it might help somebody else. So here is what i do:
Code: YUI({ filter:"debug",/* min|raw */ modules:{ 'gallery-yui3treeview':{ fullpath: '/yui3-gallery/build/gallery-yui3treeview/gallery-yui3treeview-min.js', requires:["substitute","widget","widget-parent","widget-child","node-focusmanager"], optional: [], supersedes: [] } } }).use('gallery-yui3treeview', function(Y) { var treeview = new Y.TreeView({ srcNode: '#mytree', contentBox: null, type: "TreeView", children: [ { label: "level1-1", type: "TreeView", children: [ {label: "level2-1", id:"123"}, {label: "level2-2", id:"456"} ] }, { type: "TreeView", label : "level1-2" } ] }); treeview.render(); }); /paolo |
| Page 1 of 1 | [ 6 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