How do I remove the close icon from the extlib Dialog?

前端 未结 1 1623
半阙折子戏
半阙折子戏 2021-01-24 16:49

I am using the extlib Dialog component to display some data. I want the user to only close the dialog via a button I have in it.

I can\'t see any option to disable the

相关标签:
1条回答
  • 2021-01-24 17:34

    css rules, again! As far as I can see there's no "native" way to get rid of that close button (and to be honest, I don't think it's a really good idea to do so; see below). But using some css you of course can hide anything you want on your page.

    Just give your dialog some custom styleClass; at runtime this custom class is then added to the dialog's outer div-container. The close button itself is an link inside a span; the has tow style classes, one being "lotusClose". Finally adding this piece of code to your style sheet will hide the button:

    div.yourCustomClass a.lotusClose {display:none;}
    

    Caveat: The "close" button is there on purpose. And instead of hiding it I would rather add some kind of validation code to your dialog's close event. There are numerous examples, but maybe you just want to refer to dojotoolkit.org's reference for dijit.Dialog (section "Forms and Functionality in Dialogs).

    Btw: since the dialog is based on dijit.Dialog you may also want to browse stackoverflow's dojo section.

    0 讨论(0)
提交回复
热议问题