我想将一个参数传递给dojo 1,7+中的一个事件.
假设我有以下模块:
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>
Run Code Online (Sandbox Code Playgroud)
在普通的html中,我可以这样做:onClick ="sortBy('date')"
但是在dojo中,我必须使用它:
data-dojo-attach-event ="onClick:_sortBy"
我想绑定函数sortBy()到一个按钮,我如何将sortType传递给sortBy()函数.
提前致谢 :)
我正在尝试将 AJV 与以下代码一起使用,当我验证具有多个错误的对象时,AJV 一次只抛出一个错误。
const schema = {
type: 'object',
properties: {
name: {type: 'string', minLength: 1, maxLength: 1},
sku: { type: 'string', minLength: 1, maxLength: 200},
},
required: ['name', 'sku']
}
const ajv = require('ajv');
const validator = new ajv();
const valid = validator.validate(schema, {});
if (!valid) {
console.log(validator.errors);
}Run Code Online (Sandbox Code Playgroud)
[ { keyword: 'required',
dataPath: '',
schemaPath: '#/required',
params: { missingProperty: 'name' },
message: 'should have required property \'name\'' } ]Run Code Online (Sandbox Code Playgroud)
为了创建Web内容,使用Web内容portlet.这个portlet背后有什么技术?用于开发此portlet的是什么?JSP,JSF,Struts,Icefaces还是其他任何东西?
此外,是否有单独下载它的链接.
javascript ×2
liferay ×2
ajv ×1
arguments ×1
dojo ×1
ecmascript-6 ×1
node.js ×1
portlet ×1
webcontent ×1