2

我想去掉 Google Closure 对话框右上角的关闭/X 按钮。

我正在浏览文档(http://closure-library.googlecode.com/svn-history/r8/trunk/closure/goog/docs/class_goog_ui_Dialog.html)并且找不到这样做的方法。

4

2 回答 2

4

方法来了!请参阅http://closure-library.googlecode.com/svn/docs/class_goog_ui_Dialog.html

dialog.setHasTitleCloseButton(false);

问候,

雷内

于 2012-07-21T22:20:51.277 回答
2

标题goog.ui.Dialog栏关闭按钮可以通过先调用goog.ui.Dialog.prototype.getTitleCloseElement()然后再调用来禁用goog.style.showElement(el, display)

例子

var dialog = new goog.ui.Dialog();
dialog.setContent('Lorem ipsum dolor sit amet, consectetuer' +
    'adipiscing elit. Aenean sollicitudin ultrices urna. Proin vehicula ' +
    'mauris ac est. Ut scelerisque, risus ut facilisis dictum, est massa ' +
    'lacinia lorem, in fermentum purus ligula quis nunc. Duis porttitor ' +
    'euismod risus. Nam hendrerit lacus vehicula augue. Duis ante.');
dialog.setTitle('Lorem ipsum');
dialog.setButtonSet(goog.ui.Dialog.ButtonSet.createYesNo());

var titleCloseEl = dialog.getTitleCloseElement();
goog.style.showElement(titleCloseEl, false);
于 2012-06-16T06:55:12.577 回答