我有Dojo Dialog box
使用dijit.Dialog
库。它出现在Rowclick
的{{1}}事件中。现在当它出现时我希望它是透明的或降低其不透明度,以便无论在我的背景中我能看到它并且它看起来很好。我的对话框是一个简单的Dojo grid
。
代码是::
<div> with data-dojo-type="dijit.Dialog"
<div id="terms" name ="hi" data-dojo-type="dijit.Dialog" style="height:580px;width:900px;" data-dojo-props="title:'Control Activities'" preload="true">
<center><p><strong>EDIT AN ACTIVITY </strong></p></center>
<center><table>
<tr style="height: 50px">
<td style="width: 150px" align="right"><b>ASSIGNED BY :    </b></td>
<td style="width: 600px" align="left"><div id="plets"><input dojoType="dijit.form.ValidationTextBox" id="dassignedbyid" name="dassignedbyname" onfocus="hello()" required="true"></div>
<span dojoType="dijit.Tooltip" connectId="dassignedbyid">Enter Name</span></td>
<td style="width: 150px" align="right"><b>ASSIGNED TO :    </b></td>
<td style="width: 600px" align="left"><div id="plets1"><input dojoType="dijit.form.ValidationTextBox" id="dassignedtoid" name="dassignedtoname" onfocus="hello()" required="true"></div>
<span dojoType="dijit.Tooltip" connectId="dassignedtoid">Enter Name</span></td></tr>
</table></center>
</div>
出现在此代码::
Dialog box id= terms
现在我希望当dojo.connect(grid, "onRowClick", grid, function(){
var items = grid.selection.getSelected();
dojo.forEach(items, function(item){
var v = grid.store.getValue(item, "ActID");
getdetailsfordialog(v);
function showDialog(){
dojo.require('dijit.Tooltip');
dijit.byId("terms").show();
document.getElementById('closelabelspan').style.display = 'none';
document.getElementById('holdlabelspan').style.display = 'none';
document.getElementById('startlabelspan').style.display = 'none';
document.getElementById('cancellabelspan').style.display = 'none';
document.getElementById('updatelabelspan').style.display = 'none';
}
showDialog();
}, grid);
});
弹出时它是透明的。我也试过一个CSS,但是我不能为我工作::
dialog box(terms)
我正在使用IE8。
怎么做?谢谢..
功能<style>
div.transbox
{
width:900px;
height:580px;
background-color:#FFFFFF;
border:2px solid black;
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
}
</style>
编辑::
showDialog()
答案 0 :(得分:2)
通过编程
var dia = new dijit.Dialog({
title: "Click me!",
onShow: function() {
var me = this;
// show routine sets opacity to 1, wait till it has and reset
// second style call sets the underlay as well
setTimeout(function() {
dojo.style(me.domNode, "opacity", 0.4);
dojo.style(dojo.byId(me.underlayAttrs.dialogId + me.underlayAttrs["class"]), "opacity", 0.4);
}, 1000);
},
content: 'simple contents'
});
dia.startup();
dia.show();
通过加价;
<div data-dojo-type="dijit.Dialog" style="height:580px;width:900px;"
data-dojo-props="title:'Control Activities'" preload="true">
<script type="dojo/method" data-dojo-event="onShow" data-dojo-args="">
var me = this;
// show routine sets opacity to 1, wait till it has and reset
// second style call sets the underlay as well
setTimeout(function() {
dojo.style(me.domNode, "opacity", 0.4);
dojo.style(dojo.byId(me.underlayAttrs.dialogId + me.underlayAttrs["class"]), "opacity", 0.4);
}, 1000);
</script>
</div>
答案 1 :(得分:0)
dijit对话框css样式文件具有:.dijitDialogUnderlay 将“ backgounrd-color”属性更改为:background-color:#0000;