我有一个父元素的点击事件,并将该事件委托给它的子元素。但是,我希望能够触发此单击并将模拟单击事件的信息传递给事件侦听器。
$('rt-main').addEvent('click:relay(.catClick)', function(e){
e.stop();
new Request({
method: 'get',
url: 'index.php?option=com_categories&tmpl=component&view=listing&cat=' + this.get('id'),
onComplete: function(response){
$('rt-main').set('html', response);
}
}).send();
});
// Here I want to fire the event. But how to pass in 'id' of my choosing?
// I know that this particular line fires the first anchor. How do I target a
// psuedo-anchor? Or is it better to target a class?
$('rt-main').fireEvent('click',
{target: $('rt-main').getElement('a'), stop: Function.from}
);