我的dojo应用程序在构建之后中断,在加载应用程序期间,抛出'multipleDefine'并给出此错误:
错误{src:"dojoLoader",info:Object}
消息:multipleDefine
info:Object {pid:"dojo",mid:"dojo/nls/dojo_en-us",pack:Object,url:"dojo/nls/dojo_en-us.js",执行:5 ...}
这是我的个人资料:
var profile = {
// `basePath` is relative to the directory containing this profile file; in this case, it is being set to the
// src/ directory, which is the same place as the `baseUrl` directory in the loader configuration. (If you change
// this, you will also need to update run.js.)
basePath: '../src/',
// This is the directory within the release directory where built packages will be placed. The release directory
// …
Run Code Online (Sandbox Code Playgroud) 我有一个JS覆盖层,它在我的Web应用程序上设置数据输入控件作为dojo小部件.我抓住像<input type ="text"class ="date"/>这样的输入并将它们变成DateTextBox
小部件.
这是我的基本代码:
var df = dateformat;
df.replace('mm', 'MM');
var val = input.value;
if (val == undefined){
val = '';
}
return new datebox({
"label": input.title,
"value": val,
"name": input.name,
"id": input.id,
"constraints": { "datePattern": df }
});
Run Code Online (Sandbox Code Playgroud)
我的问题是,如果没有提供任何值,所有DateTextBox的最终设置为'1970-00-01'作为初始日期.如果没有提供任何值,我希望将它们设置为null或undef,但这在启动之后似乎不可能.
在我打电话之前有没有办法设置这个widget.startup()
?
我有textarea这是必填字段.我发现帖子暗示Dojo没有对Textarea进行验证,但在Dojo 1.9中,有一个"必需"的参数.
我做了以下事情:
new Textarea({required:true, value:""}, query('[name=description]')[0])
Run Code Online (Sandbox Code Playgroud)
但效果不是我所期望的.texarea总是有红色边框,即使字段没有聚焦(例如,与ValidationTextBox相反).但是当我打电话时:
form.validate()
Run Code Online (Sandbox Code Playgroud)
即使texarea为空,验证也会通过.
是否有可能让Textare的行为与ValidationTextBox中的相同,或者就目前而言,该组件的验证尚未准备就绪,我必须编写自定义版本(如链接帖子中)或等待下一个Dojo?
dojo ×3
dojo-1.9 ×3
dijit.form ×1
dojo-build ×1
javascript ×1
locale ×1
nls ×1
textarea ×1
validation ×1