LayaBox关于获取列表里通过单个的点击事件控制cell里单个节点的变化

  function updateItem(cell, index) {
            // console.log("更新元素:", cell, index, cell._dataSource);
            // console.log(cell.getChildByName("btnGet"));

            cell.getChildByName("lblID").text = cell._dataSource.total_score;
            cell.getChildByName('headIcon').skin = cell._dataSource.icon_big == "" ? 'wxlocal/Common/avstar.png' : cell._dataSource.icon_big;
            cell.getChildByName("item0").getChildByName('propIcon0').skin = "wxlocal/props/icon_" + cell._dataSource.icon_arr[0].icon_url + '.png';
            cell.getChildByName("up").getChildByName('lblUp').text = cell._dataSource.icon_arr[0].reward_num;
            cell.getChildByName("item1").getChildByName('propIcon1').skin = "wxlocal/props/icon_" + cell._dataSource.icon_arr[1].icon_url + '.png';
            cell.getChildByName("down").getChildByName('lblDown').text = cell._dataSource.icon_arr[1].reward_num;
            cell.getChildByName("btnGet").disabled = true;
            cell.getChildByName("redPoint").visible = false;

            if (cell._dataSource.status == "running") {

            } else if (cell._dataSource.status == "waiting") {
                cell.getChildByName("redPoint").disabled = false;
                cell.getChildByName("btnGet").disabled = false;
                cell.getChildByName("btnGet").gray = false
                // cell.getChildByName("btnGet").clickHandler = Laya.Handler.create(this, function (res) {
                cell.getChildByName("btnGet").clickHandler = Laya.Handler.create(this, function () {
                    // cell.getChildByName("btnGet").on(Event.CLICK, this, function (res) {
                    console.log(cell)
                    // cell.disabled=true;
                    cell.getChildAt(8).disabled = true //根据节点顺序控制节点
}

cell.getChildAt(8).disabled = true

根据列表顺序  获取节点

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值