0
votes

I have a list set by a store and styled by an itemtpl in sencha like so:

xtype: 'list',
        id: 'messageList',
        store: 'messageStore',
        itemTpl: mytemplate

Each list item has an handler on itemtap and itemswipe. Itemswipe does a slide animation to expose a delete button hidden off to the left with some css trickery. I have no problem doing the animation the problem I have is when one item is slid out, if another item is slid out i would like to slide the other item back into place.

I had thought that this would work :

var store = Ext.StoreMgr.get('messageStore');
            store.data.items[index].data.Slidout = true;
            for (var i = 0; i < store.data.items.length; i++){
                if (store.data.items[i].data.Slidout == true){
                    var items = Ext.getCmp('messageList').items;
                    //unhide items[i]
                }
            }

What I'm essentially asking is how to access the items in the list so I can fire an animation on them programatically.

2

2 Answers

1
votes

If I get you right you could access the items in the list with getItems()

Ext.getCmp('messageList').getItems();

EDIT:

You are right, the method you are looking for is getViewItems()

Ext.getCmp('messageList').getViewItems();
0
votes

I think getItems() gives you the value of the items..