我希望在dojo 1.7+中向事件传递参数。假设我有以下模块:
在普通的html中,我可以这样做:onClick="sortBy('date')"
但在dojo中,我必须使用以下代码:
data-dojo-attach-event="onClick: _sortBy"
我想要将函数sortBy()绑定到一个按钮上,如何向sortBy()函数传递sortType参数。
提前感谢您的帮助 :)
define(
[ "dojo/dom", "dojo/dom-style", "dijit/registry", "js/busyIndicator",
"dojox/mobile/ListItem", "dojo/dom-class",
"ppwidgets/MyCommunitesRecentListItem", "js/utils"
],
function(dom, domStyle, registry, busyIndicator, ListItem,
domClass, MyCommunitesRecentListItem, utils) {
return {
sortBy: function(sortType) {
}};
}
);
<h3>In html:</h3>
在普通的html中,我可以这样做:onClick="sortBy('date')"
但在dojo中,我必须使用以下代码:
data-dojo-attach-event="onClick: _sortBy"
我想要将函数sortBy()绑定到一个按钮上,如何向sortBy()函数传递sortType参数。
提前感谢您的帮助 :)