2014-04-07 51 views
1

在Worklight中使用dojo時,我的標題標籤出現兩次(重複)。Worklight dojo標題標籤被複制

的index.html

<div 
    id="info" 
    data-dojo-type="dojox.mobile.Heading" 
    data-dojo-props='label:"User Information"' 
    style = "background-color: silver; font-size: 20px;"> 
</div> 

謝謝!

+0

可以將您提供一些代碼? –

回答

0

我已經將您的代碼片段更改爲以下內容,並且適用於我的任何重複。 注意帶引號的data-dojo-props的輕微更改。

<div 
    id="info" 
    data-dojo-type="dojox.mobile.Heading" 
    data-dojo-props="label:'User Information'" 
    style = "background-color: silver; font-size: 20px;"> 
</div> 

我已經創建了一個道場新的工作燈項目和應用程序(使用工作燈混合應用程序嚮導),並補充修改後的代碼片段。我只看到1個標題。

我的index.html

<!DOCTYPE HTML> 
<html> 
     <head> 
      <meta charset="UTF-8"> 
      <title>dojotest</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"> 
      <meta name="apple-mobile-web-app-capable" content="yes"> 
      <link rel="shortcut icon" href="images/favicon.png"> 
      <link rel="apple-touch-icon" href="images/apple-touch-icon.png"> 
      <link rel="stylesheet" href="css/main.css"> 
      <script>window.$ = window.jQuery = WLJQ;</script> 
      <script type="text/javascript" src="dojox/mobile/deviceTheme.js"></script> 
      <script type="text/javascript" data-dojo-config="isDebug: false, async: true, parseOnLoad: true, mblHideAddressBar: false" src="dojo/dojo.js"></script> 
     </head> 
     <body style="display: none;"> 
      <div data-dojo-type="dojox.mobile.ScrollableView" id="view0" data-dojo-props="selected:true"> 
       <div 
        id="info" 
        data-dojo-type="dojox.mobile.Heading" 
        data-dojo-props="label:'User Information'" 
        style = "background-color: silver; font-size: 20px;"> 
       </div> 
      </div> 
      <script src="js/initOptions.js"></script> 
      <script src="js/main.js"></script> 
      <script src="js/messages.js"></script> 
     </body> 
</html> 

enter image description here

+0

對不起,它不適用於我:(也許我在.js文件中有問題?函數dojoInit(){ \t require([「dojo/ready」,「dojo/_base/kernel」,「dojo/parser」 ,「dojox/mobile」,「dojo/dom」,「dijit/registry」,「dojox/mobile/ScrollableView」,「dojox/mobile/TabBarButton」,「dojox/mobile/TextArea」,「dojox/mobile/「DojoX中/移動/按鈕」, 「DojoX中/ dgauges /組件/默認/ SemiCircularLinearGauge」],函數(就緒){ \t \t就緒(函數(){ \t \t}); \t});} – user3503592