zoukankan      html  css  js  c++  java
  • wex5 onactive不执行的解决办法

    由index.w点击某个图片,转到adetail,希望每次adetail加载时,取到参数id

    index.w

    <tbody class="x-list-template" xid="listTemplate3">
    <tr xid="tr4">
    <td xid="td6" class="tdd" bind-click="{&quot;operation&quot;:&quot;shell.showPage&quot;,&quot;args&quot;:{&quot;url&quot;:&quot;js:$model.toUrl('./adetail.w?id=1')&quot;}}">
    <a><img alt="" xid="image22"
    class="img-rounded img-responsive center-block" src="./img/a1.png"/></a>
    <div xid="div15" class="text text-center">
    <h4 xid="h43" class="text-white">宠物蛇</h4>
    <h5 xid="h54" class="text-danger">¥2922</h5>
    <div style="height:20px;"></div>
    </div>
    </td>
    <td xid="td7" class="tdd" bind-click="{&quot;operation&quot;:&quot;shell.showPage&quot;,&quot;args&quot;:{&quot;url&quot;:&quot;js:$model.toUrl('./adetail.w?id=2')&quot;}}">
    <a><img alt="" xid="image23"
    class="img-rounded img-responsive center-block" src="./img/a2.png"/></a>
    <div xid="div17" class="text text-center">
    <h4 xid="h44" class="text-white">蛋龟</h4>
    <h5 xid="h55" class="text-danger">¥2129</h5>
    <div style="height:20px;"></div>
    </div>
    </td>
    ....
     
    index.js

    ...

    adetail.w

    <?xml version="1.0" encoding="utf-8"?>

    <div xmlns="http://www.w3.org/1999/xhtml" class="main13" component="$UI/system/components/justep/window/window"
    design="device:m;" xid="window" sysParam="false">
    <div component="$UI/system/components/justep/model/model" xid="model" style="left:18px;top:83px;height:244px;" onActive="doActive();"/>
    <div component="$UI/system/components/justep/panel/panel" class="x-panel x-full x-card">
    <div class="x-panel-top">
    ....
     
    adetail.js
    define(function(require) {
        var $ = require("jquery");
        var justep = require("$UI/system/lib/justep");
        var comUtil = require("$UI/system/components/justep/common/common");

        var Model = function() {
            this.callParent();
        };
     
    Model.prototype.doActive = function(event) {
            console.log('onActive');
            var context = this.getContext();
     
    //获取URL中的参数
            var id = context.getRequestParameter('id');
            console.log(id);
        }
    return Model;
    });
  • 相关阅读:
    t
    bert4keras
    embeding应用-airbnb推荐
    The Neural Autoregressive Distribution Estimator
    3.redis desktop manager--redis 可视化工具安装及使用
    Day06作业(postman接口测试)
    DRF学习day01(web应用模式,api接口,RESTful API规范,序列化,Django Rest_Framework)
    restFul接口设计规范
    Vue学习之荏苒资讯项目(一)
    微信小程序开发四:Promise的使用,解决回调地狱
  • 原文地址:https://www.cnblogs.com/yuanxiaoping_21cn_com/p/7481303.html
Copyright © 2011-2022 走看看