• 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;
    });
  • 相关阅读:
    2-7.交集选择器
    2-6.并集选择器
    2-5.后代选择器
    python----字符串,反向编码与乱码记录
    python----输出1-100之和的方法
    python----基础之三元运算、文件操作
    python----基础之令人头疼的字符编码
    python----基础之可变、不可变数据类型、collections模块
    python----基础之数据类型(元祖,字典,集合)
    python----基础之变量的创建与id
  • 原文地址:https://www.cnblogs.com/yuanxiaoping_21cn_com/p/7481303.html
Copyright © 2020-2023  润新知