当我单击按钮时,它必须显示对话框,但它没有显示。我从 dojo 文档中找到了这段代码。当我单击按钮时,它没有显示任何内容。这是我的代码,请帮助我。
<script type="text/javascript">
dojo.require("dijit.form.Form");
dojo.require("dijit.Dialog");
dojo.require("dijit.form.Button");
dojo.require("dojo.parser");
dojo.require("dijit.form.TextBox");
</script>
<body class="claro">
<div id="gridDiv"></div>
<div data-dojo-type="dijit.Dialog" id="formDialog2"
title="Filtering Rows" style="display: none">
<form data-dojo-type="dijit.form.Form" id="123">
<script type="dojo/event" data-dojo-event="onSubmit"
data-dojo-args="e">
require(["dojo/dom"], function(dom){
var f = dojo.byId("123");
var s = "";
var elem = f.elements[0];
s = elem.value;
dijit.byId('grid').filterBar(s);
});
return false;
</script>
Search: <input type="text" name="searchtext" value=""
data-dojo-type="dijit/form/TextBox">
<div class="dijitDialogPaneActionBar">
<button data-dojo-type="dijit.form.Button" type="submit">OK</button>
<button data-dojo-type="dijit.form.Button" type="button"
data-dojo-props="onClick:function(){dijit.byId('formDialog2').hide();}">Cancel</button>
</div>
</form>
</div>
<button id="buttonThree" data-dojo-type="dijit.form.Button"
type="button">
Show Filter
<script type="dojo/method" data-dojo-event="onClick"
data-dojo-args="evt">
dijit.byId("formDialog2").show();
</script>
</button>