• 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;
    });
  • 相关阅读:
    文件系统EXT3,EXT4和XFS的区别
    怎么让系统开机运行一个脚本:
    Linux系统的开机启动顺序:
    Linux根目录扩容方法及其涉及的相关磁盘操作
    创建账户和授权的作业
    crontab 定时任务:
    Ubuntu系统Daphne + Nginx + supervisor部署Django项目
    mysql离线安装
    mongodb集群运维
    nodeexporter新增自定义模块
  • 原文地址:https://www.cnblogs.com/yuanxiaoping_21cn_com/p/7481303.html
Copyright © 2020-2023  润新知