0
當我點擊按鈕它必須顯示對話框,但它不顯示。我從dojo文檔中找到了這個代碼。當我點擊按鈕時,它沒有顯示任何東西。這裏是我的代碼,請幫助我。對話框沒有顯示在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>
是的,我需要聲明 – sirisha
你有parseonload作爲djConfig的一部分。因爲在小提琴中看到,您的代碼工作。 – tik27