开发者

yui2 and yui3 events

开发者 https://www.devze.com 2023-01-16 05:52 出处:网络
Can the yui3 construct of Y.on() be used to setup listeners fo开发者_运维问答r events on yui2 widgets, or do they simply use separate event systems?They use separate event systems.However, you can use

Can the yui3 construct of Y.on() be used to setup listeners fo开发者_运维问答r events on yui2 widgets, or do they simply use separate event systems?


They use separate event systems. However, you can use Y.on() to set up DOM listeners that trigger methods on YUI 2 Widgets.

Y.on('focus', Y.bind(myCalendar.show, myCalendar), '#birthdate');

or more generically

Y.on('click', function () {
    /* do other stuff... */

    myDataSource.sendRequest('filter=active', {
        success: myDataTable.onDataReturnInitializeTable,
        scope: myDataTable
    });

    /* ...and more stuff */
}, '#date-filter');

Y.on() can't be used to subscribe to widget custom events in YUI 2, though.

Y.on('activeTabChange', thisWontWork, myTabView); // does nothing
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号