0

我制作了一个简单的移动应用程序(使用 Worklight Studio)。我为这个应用程序添加了 Dojo 功能。所以,我有一个 TabBar,我想对点击标签有一些操作

MainPage.html(部分)

<ul data-dojo-type="dojox.mobile.TabBar">
<li id="accountInfoButton" data-dojo-type="dojox.mobile.TabBarButton" icon="images/AccountInfoIcon.png" data-dojo-props="transition:'slide',dir:'1',url : 'views/account_info.html'">Account Info</li>

account_info.html

<div data-dojo-type="dojox/mobile/RoundRect" shadow="true">
<input id="name" dojoType="dojox.mobile.TextBox" selectOnClick="true" type=text name="name"></input>
</div>
<script src="../js/AccountInfoLoad.js"></script>

AccountInfoLoad.js

require("dojo/ready", function(ready){
    ready(function(){
        dojo.byId("name").innerHTML = 'John Doe';
    });
});

但是当我单击“帐户信息”选项卡时没有任何反应

有人可以帮我弄这个吗?

谢谢!!

4

1 回答 1

0

从您的代码片段中,我相信这对您不起作用,因为您moveTo:'<view id>'data-dojo-props.
您需要指定要在要转换到的页面中显示的视图。

以下对我有用:

索引.html

<div data-dojo-type="dojox.mobile.ScrollableView" id="view0" data-dojo-props="selected:true">
    Lorem ipsum dolor sit amet, ...

    <ul data-dojo-type="dojox.mobile.TabBar" fixed="bottom">
        <li data-dojo-type="dojox.mobile.TabBarButton" id="tab1" data-dojo-props="url:'view1.html', moveTo:'view1', transition:'flip'">Label</li>
    </ul>
</div>

view1.html

<div data-dojo-type="dojox.mobile.View" id="view1" data-dojo-props="selected:false">
    In view 1   
</div>
于 2014-09-25T12:11:24.603 回答