Hybrid View
-
18 Mar 2011 2:22 PM #1
Deselect ListItem on Tap?
Deselect ListItem on Tap?
Sorry, it's me again. It's been a long day today and I'm tired so perhaps I missed it, but I can't get the items in a List to deselect when showing an ActionSheet.
Essentially, I want the list to display an ActionSheet when the user taps an item. I've got all of this working without problem, but for I can't figure out to remove the selected class once the ActionSheet has been displayed. Here's a screenshot of the situation at the moment:
As you can see, the item is still selected underneath the overlay. Any idea how I can prevent it from remaining selected?
Thanks,
Ben.
-
19 Mar 2011 3:32 AM #2
You could call the deselect method of the Ext.List class when you show the action sheet passing in the output of the getSelectedRecords method?
SwarmOnline.com - Web & Mobile Development and Training Services
Check out our Ext JS 4 Cookbook
...and the FREE e-book Ext JS 4 Cookbook - Exploring Further filled with recipes that we couldn't fit in!
@StuartAshworth9
@SwarmOnline
-
19 Mar 2011 5:11 AM #3
Thanks Stoot, this is the solution I have at the moment, but just wondered if there was a parameter built into the List constructor?
Regards,
Ben.
-
20 Mar 2011 7:54 AM #4
Back again, and still not able to solve the problem here - sorry to be such a pain.
Here's the function I have bound to the itemTap event:
However, this seems to return the error:Code: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(); }. Can anyone shed any light on the matter?Code:Object [object Object] has no method 'deselect'
Thanks,
Ben.
-
20 Mar 2011 7:58 AM #5
I think the deselect method is a method of the List rather than the store.
SwarmOnline.com - Web & Mobile Development and Training Services
Check out our Ext JS 4 Cookbook
...and the FREE e-book Ext JS 4 Cookbook - Exploring Further filled with recipes that we couldn't fit in!
@StuartAshworth9
@SwarmOnline
-
20 Mar 2011 8:01 AM #6
Thanks for the quick reply, that seems to have prevented the error from occurring, but no deselect occurs. Am I using the method correctly?
Code:list.deselect(list.getStore().getAt(index), true);
Similar Threads
-
Button in listitem
By J-zY in forum Sencha Touch 1.x: DiscussionReplies: 1Last Post: 18 Mar 2011, 12:20 AM -
datepicker deselect value
By nicobarten in forum Ext 3.x: Help & DiscussionReplies: 5Last Post: 8 Mar 2010, 5:48 AM -
GridPanel deselect
By bello in forum Ext 3.x: Help & DiscussionReplies: 3Last Post: 14 Feb 2010, 10:17 AM -
[already on its way] Ext.View - deselect
By andrei.neculau in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 22 Sep 2007, 10:34 PM -
Help Deselect Tab
By reang in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 9 Apr 2007, 2:26 AM


Reply With Quote