[ 3 posts ]

Marc

YUI Contributor

  • Offline
  • Profile

Click handler not firing

Post Posted: Tue Jun 08, 2010 6:20 am
+0-
I've got the popdown working now, but the click handler is not firing:
Code:
<html>
<head>
<script src="http://yui.yahooapis.com/3.1.1/build/yui/yui-min.js"></script>
<script src="../js/yui-library/gallery-ac-widget/gallery-ac-widget.js"></script>
<script src="../js/yui-library/gallery-ac-plugin/gallery-ac-plugin.js"></script>
</head>
<body>
<script>
YUI({
    //Last Gallery Build of this module
    //gallery: 'gallery-2010.06.07-17-52'
}).use('gallery-ac-plugin','gallery-ac-widget','datasource', 'node', function (Y) {
 
    new Y.ACWidget({
        ac : Y.get("#input").plug(Y.Plugin.ACPlugin, {
            queryTemplate : function (q) { return "q=" + encodeURIComponent(
                "select * from search.suggest where query =\"" +
                q.replace(/(["\\])/g, '\\$1') +
                "\" limit 10"
            )},
            dataSource : new Y.DataSource.Get({
                source : "http://query.yahooapis.com/v1/public/yql?" +
                    "format=json&" +
                    "env=http%3A%2F%2Fdatatables.org%2Falltables.env&",
                scriptCallbackParam : "callback"
            }).plug({fn : Y.Plugin.DataSourceJSONSchema, cfg : {
                schema : { resultListLocator : "query.results.Result" }
            }})
        }).ac
    }).render();
 
});
</script>
<form>
tekst <input type="text name="search" id="input">
</form>
</body>
</html>


I'm using a local version in order to correct some of the errors in the code.

Marc

YUI Contributor

  • Offline
  • Profile

Re: Click handler not firing

Post Posted: Tue Jun 08, 2010 6:58 am
+0-
Hmm, well this is resolved by removing the 'category+' elements at line 86,87,88 in widget-base.
Perhaps I got some dev version or something

So, it should be :
Code:
                cb.delegate("click", widget.click, "li", widget);
                Y.on("click", widget.hide, document); //INHERITED
                ac.on("ac:load", function (e) {

Now it works for me

Marc

YUI Contributor

  • Offline
  • Profile

Re: Click handler not firing

Post Posted: Tue Jun 08, 2010 7:00 am
+0-
And lines 99,102,103,104.

Also noticed this in ac-plugin at lines
199,201,203,205
  [ 3 posts ]
Display posts from previous:  Sort by  
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