gxt加载片段

时间:2011-10-17 14:56:14

标签: javascript html css gwt gxt

我在gxt应用程序上使用该代码,以获得加载片段项:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <link type="text/css" rel="stylesheet" href="gxt/css/gxt-all.css" />
    <link type="text/css" rel="stylesheet" href="MyApp.css">
    <title>MyApp</title>    
  </head>
  <body>
<style>
#loading {
position: absolute; left: 45%; top: 40%; padding: 2px;   
margin-left:-45px; z-index:20001; border:1px solid #ccc;
}
#loading .loading-indicator {
background:#eef;font:bold 13px tahoma,arial,helvetica;
padding:10px;margin:0;height:auto;color:#444; 
}
#loading .loading-indicator img {
margin-right:8px; float:left; vertical-align:top;
}
#loading-msg {font:normal 10px arial,tahoma,sans-serif;}
</style>
<div id="loading">
<div class="loading-indicator">
<img src="gxt/images/default/shared/large-loading.gif"/>
myCustomerContacts<br />
<span id="loading-msg">Loading application...</span>
</div>
</div>
    <script type="text/javascript" language="javascript" src="myapp/myapp.nocache.js"></script>
  </body>

</html>

为什么加载,为什么加载片段在加载应用程序时停止?

1 个答案:

答案 0 :(得分:0)

加载应用程序后,您需要从DOM中删除加载div。

这可以这样做:

 DOM.removeChild(RootPanel.getBodyElement(), DOM.getElementById("loading"));

以下是GWT团队的David Chandler关于您要做的事情的总结:http://turbomanage.wordpress.com/2009/10/13/how-to-create-a-splash-screen-while-gwt-loads/