PDA

View Full Version : Tap nested list item programmatically



MrNickBarker
25 Jul 2013, 1:14 AM
We needed to tap nested list items programmatically for testing purposes, so I came up with this little function:


var selectNesetedListIndex = function (nestedList, index)
{
var list = nestedList.getActiveItem();
list.select(index);

var e = {
'target':list.getItems().items[0].innerItems[index].element
};

Ext.defer(function() {
list.fireEvent('itemtap', list, index, list.getAt(index), null, e);
}, 100);
};

This works on 2.2.1 without errors. It's hacky and likely to break in future versions of ST, but as I said this is for testing only.