0

我的选择位于具有 style 属性的 div 元素中,display:none因为它仅显示在弹出窗口中 dojo 忽略了这些,我看到一个普通的 html 选择,但弹出窗口外的相同 3 行显示了一个完美的 dijit 选择表单

我尝试隐藏可见性,但是 jquery 的 bpupop 插件无法显示 div

<select name="ToServer" id="ToServer" data-dojo-type="dijit/form/Select">
    <option value="1" label="breitseite">breitseite</option>
    <option value="2" label="pepe">pepe</option>
    <option value="3" label="grow">grow</option>
    <option value="4" label="hurricane">hurricane</option>
</select>

任何想法我做错了什么或如何在弹出窗口打开时强制dojo重新设置div

更新: 我有解析器,问题是我用相同的 id 调用了 1 个对象两次,但我现在修复了它,它是 dojo 样式,但它只显示了 select 的 1 个选项(相同的 html 输出)

在道场“渲染”之后,它看起来像这样:

<table class="dijit dijitReset dijitInline dijitLeft dijitDownArrowButton dijitSelect dijitValidationTextBox" data-dojo-attach-point="_buttonNode,tableNode,focusNode" cellspacing="0" cellpadding="0" role="listbox" aria-haspopup="true" tabindex="0" id="ToServer" widgetid="ToServer" aria-expanded="false" aria-invalid="false"><tbody role="presentation"><tr role="presentation"><td class="dijitReset dijitStretch dijitButtonContents" role="presentation"><div class="dijitReset dijitInputField dijitButtonText" data-dojo-attach-point="containerNode,_popupStateNode" role="presentation" popupactive="true"><span role="option" class="dijitReset dijitInline dijitSelectLabel dijitValidationTextBoxLabel ">breitseite</span></div><div class="dijitReset dijitValidationContainer"><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="? " type="text" tabindex="-1" readonly="readonly" role="presentation"></div><input type="hidden" name="ToServer" data-dojo-attach-point="valueNode" value="1" aria-hidden="true"></td><td class="dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer" data-dojo-attach-point="titleNode" role="presentation"><input class="dijitReset dijitInputField dijitArrowButtonInner" value="? " type="text" tabindex="-1" readonly="readonly" role="presentation"></td></tr></tbody></table></dd></div><div class="dijitPopup dijitMenuPopup" style="visibility: visible; top: 174px; z-index: 1000; right: auto; left: 619px; display: none; " role="presentation" id="ToServer_dropdown" dijitpopupparent="ToServer"><div style="overflow: visible; top: 0px; width: 67px; visibility: visible; " class="dijit dijitMenu dijitReset dijitSelectMenu dijitValidationTextBoxMenu dijitMenuPassive" role="presentation" id="ToServer_menu" widgetid="ToServer_menu" tabindex="0"><table class="dijitReset dijitMenuTable" role="listbox" tabindex="0" data-dojo-attach-event="onkeypress:_onKeyPress" cellspacing="0" style="">
<tbody class="dijitReset" data-dojo-attach-point="containerNode"><tr class="dijitReset dijitSelectSelectedOption dijitValidationTextBoxSelectedOption dijitMenuItemSelected dijitMenuItem" data-dojo-attach-point="focusNode" role="option" tabindex="-1" aria-labelledby="dijit_MenuItem_0_text dijit_MenuItem_0_accel" id="dijit_MenuItem_0" aria-disabled="false" widgetid="dijit_MenuItem_0" aria-selected="true">
<td class="dijitReset dijitMenuItemIconCell" role="presentation">
    <img src="//ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/resources/blank.gif" alt="" class="dijitIcon dijitMenuItemIcon dijitNoIcon" data-dojo-attach-point="iconNode">
</td>
<td class="dijitReset dijitMenuItemLabel" colspan="2" data-dojo-attach-point="containerNode" id="dijit_MenuItem_0_text">breitseite</td>
<td class="dijitReset dijitMenuItemAccelKey" style="display: none" data-dojo-attach-point="accelKeyNode" id="dijit_MenuItem_0_accel"></td>
<td class="dijitReset dijitMenuArrowCell" role="presentation">
    <div data-dojo-attach-point="arrowWrapper" style="visibility: hidden">
        <img src="//ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/resources/blank.gif" alt="" class="dijitMenuExpand">
        <span class="dijitMenuExpandA11y">+</span>
    </div>
</td>

佩佩+成长+飓风+

4

1 回答 1

1

<body> 如果所有元素都在具有主题集的标签内,它们都将获得 Dojo 样式。

您的问题实际上与样式无关,但很可能与解析有关。我建议您dijit/form/Select不要被解析。

您可以通过从控制台运行来确认这一点:

require(["dojo/parser"], function(parser){
  parser.parse();
});
于 2012-10-25T19:31:30.210 回答