【发布时间】:2011-07-19 02:22:47
【问题描述】:
我正在开发一个 Sencha Touch 应用程序,并且有一个联系人列表。点击列表项时,会显示一个 ActionSheet,其中显示一些基本功能(例如调用、删除和忽略)。不幸的是,当用户点击并触发 ActionSheet 时,列表项在叠加层下方仍然处于选中状态(请参见下面的屏幕截图):
这是绑定到 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'
关于我可能做错了什么或如何实现这一点的任何想法?
【问题讨论】: