[]关于下拉列表的选择触发
this.small_map.selectHandler = new Laya.Handler(this, onSelect_small);
this.big_map.selectHandler = new Laya.Handler(this, onSelect_big);
function onSelect_small(e) {
Laya.big_switch = 0
Laya.maptype = "small"
this.now_map.text = "当前地图:" + this.small_map.selectedLabel
Laya.map_small_c = e
}
function onSelect_big(e) {
if (e != 0) {
if (Laya.keys > 0) {
Laya.big_switch = 0
Laya.map_big = e
Laya.maptype = "big"
this.small_map.selectedIndex = 0
this.now_map.text = "当前地图:" + this.big_map.selectedLabel
} else {
var dia1 = new loading()
dia1.confirm.label = "大秘境钥匙不足"
dia1.loading_desc.text = "可在小秘境挂机获取"
dia1.confirm.on(Laya.Event.MOUSE_UP, this, dai1, [dia1])
dia1.popup()
// this.big_map.selectedIndex = 0
}
}
}
两个列表,手动选择会触发,没有问题,但如果在下面加一个修改下拉数据的
this.small_map.labels = “1,2,3”
上面function onSelect_small(e) 自动也执行了,如何才能,只修改数据,不执行触发?
this.big_map.selectHandler = new Laya.Handler(this, onSelect_big);
function onSelect_small(e) {
Laya.big_switch = 0
Laya.maptype = "small"
this.now_map.text = "当前地图:" + this.small_map.selectedLabel
Laya.map_small_c = e
}
function onSelect_big(e) {
if (e != 0) {
if (Laya.keys > 0) {
Laya.big_switch = 0
Laya.map_big = e
Laya.maptype = "big"
this.small_map.selectedIndex = 0
this.now_map.text = "当前地图:" + this.big_map.selectedLabel
} else {
var dia1 = new loading()
dia1.confirm.label = "大秘境钥匙不足"
dia1.loading_desc.text = "可在小秘境挂机获取"
dia1.confirm.on(Laya.Event.MOUSE_UP, this, dai1, [dia1])
dia1.popup()
// this.big_map.selectedIndex = 0
}
}
}
两个列表,手动选择会触发,没有问题,但如果在下面加一个修改下拉数据的
this.small_map.labels = “1,2,3”
上面function onSelect_small(e) 自动也执行了,如何才能,只修改数据,不执行触发?
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Aar0n
赞同来自: