0

I have dynamically added a select box of dijit.form.filteringSelect type into my page. I have called an ajax request on some button click and the content returned from the ajax request contains select box of dijit.form.filteringSelect. The select box shows up but does not appear as a dijit element.It shows up as a normal html select box without dijit style of select box. My page is something like this:

<head>
<style type="text/css">
    @import "dojo-1.7/dijit/themes/claro/claro.css";
    @import "dojo-1.7/dojo/resources/dojo.css";
    @import "dojo-1.7/dojox/grid/resources/claroGrid.css";
</style>
<script type="text/javascript" src="dojo-1.7/dojo/dojo.js" data-dojo-config="parseOnLoad: true"></script>
<script type="text/javascript">
    dojo.require("dijit.form.FilteringSelect");
</script>
</head>
<body class="claro">
//ajax output appended to body after some button click
 <select id="testSelect" data-dojo-type="dijit.form.filteringSelect">
     <option value="">...</option>
 </select>
</body>

I think the problem is rendering. How can I render dijit element when they are added dynamically using server side script like php in my case. Have I done the parsing correctly?

4

1 回答 1

0

If you know the id of the new node, you can call the dojo parser for just that node.

dojo.parser.parse("testSelect");

http://dojotoolkit.org/reference-guide/1.7/dojo/parser.html#examples

于 2012-06-21T10:06:52.503 回答