dojox移动按钮的点击事件

时间:2015-10-05 22:45:34

标签: javascript dojo

您好我正在尝试拨打我为dojox移动按钮设置的点击事件,但无法让事件调用我的功能,如下所示:

<script>
        require([
         ...
          "dojox/mobile/Button"
        ],
          function (..) {
              parser.parse();
              return {
                  //this function never gets called
                  Login: function (e) {
                      alert("you clicked?")
                  }
              }

          });
    </script>
</head>
<body>
    <ul data-dojo-type="dojox/mobile/TabBar" data-dojo-props='barType:"standardTab"'>
        <li data-dojo-type="dojox/mobile/TabBarButton" data-dojo-props='selected:true' moveto="viewLogin">Login</li>
    </ul>
    <div id="viewLogin" data-dojo-type="dojox/mobile/View">
        Login
        <button data-dojo-type="dojox/mobile/Button" data-dojo-attach-event="onclick:Login">Login</button>

    </div>

1 个答案:

答案 0 :(得分:0)

这种方式有效:

@foreach ($projects as $projects) 
{{ $projects->title}}{{ $projects->city? ', '.$projects->city : ""}}{{ $projects->state?  ', '.$projects->state : "" }}{{ $projects->country? ', '.$projects->country : "" }}
@endforeach