2010-03-12 71 views
1

是否有任何可能的方法来改变在dijit.dialog的X框上弹出的“取消”工具提示?我只是想让它阅读“关闭”。更改dijit.Dialog关闭框中的“取消”文本?

我对道场有点新鲜。我期望这可能只是一个非常简单的愚蠢问题,但我找不到任何例子。

在此先感谢。

回答

0

这是从dijit/nls...buttonCancel NLS字符串,所以你可以做的一个:

  1. 修改译文dijit's nls/目录
  2. 覆盖对话框类中定义一个新的模板(而不是Dialog.html),有您的标题文字
  3. 试试下面的代码

    dojo.connect(dijit.Dialog.prototype, "postMixInProperties", function() 
    { 
    this.buttonCancel="Close" 
    }) 
    
1

简单快捷想这是你的对话脚本

<!-- language: lang-js --> 
var defaultDialog = new dijit.Dialog({ 
     id: 'defaultDialog', 
     title: 'I can change the world', 
     draggable: false, 
     duration: 500 
     }); 

    defaultDialog.show(); 
    defaultDialog.closeButtonNode.title = 'Close'; 

嗨,我写这篇文章的解决方案为客户难和深厚的解决方法道场& dijit的源/文档3HS。

关注 JAS