| Page 1 of 1 | [ 7 posts ] |
|
Hello,
I am having issue with Combo Loader dependency loading for YUI2. I use YUI2 Data Table in my module ('yui2-datatable'). I need to enable column reordering and therefore I have to also use 'yui2-dragdrop' also. The problem is that combo loader is loading 'dragdrop' after the 'datatable'. This results in constructor for YAHOO.widget.DataTable generating exception. This is very frustrating problem and I have been looking for a while for a workaround. How can I enforce the load order? I am looking for any other workaround. Thanks This is what I have: YUI.add('my-data-table-control', function (Y) { }, '1.0.0', { loadOptional : true, requires: ['yui2-dragdrop', 'yui2-datatable'] }); |
|
Interestingly, if I move 'requires' to the configuration, it starts working, but it is ugly workaround I do not understand:
YUI.add('my-data-table-control', function (Y) { }, '1.0.0'/*, { requires: ['yui2-dragdrop', 'yui2-datatable'] }*/); var config = { modules: { 'my-data-table-control': { fullpath: myPath, // THIS SHOULD NOT BE HERE! requires: ['yui2-dragdrop', 'yui2-datatable'] } } }; |
|
What version of YUI are you using?
|
|
Tried with 3.5.0, 3.5.1, and 3.6.0pr1 - same issue. Looks like a bug to me.
I have now reverted to listing dependencies in YUI(arg).use(...) argument, not in module 'requires'. One other issue I experienced is that with YUI(arg).use(...) and "combine: true, maxURLLength: 2048" in the 'arg' I have one single request going to the server, but once I move dependencies to my modules, I end up with multiple requests generated by YUI to my combo server, that is not desirable for me. |
|
Please file an ticket for the requires issue. It should work as you expect and I have several tests to verify that my use cases are passing.
As for the single request, you are using it correctly. If you want a longer URL length for the combo you must use the `maxURLLength` config (that's what it's there for). |
|
Dav,
I was able to duplicate it in a very simple test. I will file a bug next week, unless you want to take a quick look: HTML: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Loader test</title> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/fonts/fonts-min.css" /> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/datatable/assets/skins/sam/datatable.css" /> <script type="text/javascript" src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script> </head> <body class="yui-skin-sam"> <div id="basic"></div> </body> <script type="text/javascript"> var config = { modules: { 'my-module': { async: false, fullpath: 'loaderTestModule.js' } } }; YUI(config).use('my-module', function (Y) { new Y.MyModule(); }); </script> MODULE: YUI.add('my-module', function (Y) { Y.MyModule = function () { var myColumnDefs = [ { key: "id", sortable: true, resizeable: true }, { key: "quantity", sortable: true, resizeable: true } ]; var myDataSource = new Y.YUI2.util.DataSource([ { id: "po-0167", quantity: 1 } ]); myDataSource.responseType = Y.YUI2.util.DataSource.TYPE_JSARRAY; myDataSource.responseSchema = { fields: ["id", "quantity"] }; var myDataTable = new Y.YUI2.widget.DataTable("basic", myColumnDefs, myDataSource, { caption: "DataTable Caption", scrollable: true, draggableColumns: true }); }; }, '1.0.0', { requires: ['yui2-dragdrop', 'yui2-datatable'] }); |
|
Ticket Created: http://yuilibrary.com/projects/yui3/ticket/2532344
|
| Page 1 of 1 | [ 7 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