gpt4 book ai didi

javascript - Sencha Touch - 取消选择列表项?

转载 作者:可可西里 更新时间:2023-11-01 01:56:19 24 4
gpt4 key购买 nike

我正在开发一个 Sencha Touch 应用程序,并且有一个联系人列表。当点击列表项时,会显示一个 ActionSheet,显示一些基本功能(例如调用、删除和忽略)。不幸的是,当用户点击并触发 ActionSheet 时,列表项在叠加层下方保持选中状态(请参见下面的屏幕截图):

Screenshot of iOS Simulator

这是绑定(bind)到 itemTap 事件的函数:

itemTap: function(list, index)
{
// Deselect the selected record:
var currentRecord = list.getStore().getAt(index);
currentRecord.forename = currentRecord.get('forename');
currentRecord.surname = currentRecord.get('surname');
currentRecord.phoneNumber = currentRecord.get('phoneNumber');
currentRecord.shortFullName = currentRecord.forename + ' ' + currentRecord.surname[0];

list.getStore().deselect(index, true);

callButton.setText('Call ' + currentRecord.shortFullName + ' (' + currentRecord.phoneNumber + ')');
unfriendButton.setText('Remove ' + currentRecord.shortFullName + ' as friend');
friendActionSheet.show();
}

不幸的是,list.getStore().deselect(index, true) 返回以下错误:Object [object Object] has no method 'deselect'

关于我可能做错了什么,或者我如何才能做到这一点,有什么想法吗?

最佳答案

这对我有用:

    listeners: {
itemtap: function(dv, ix, item, e) {
// Clear the selection soon
setTimeout(function(){dv.deselect(ix);},500);
}
}

关于javascript - Sencha Touch - 取消选择列表项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5368188/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com