Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sencha: How to trigger click event on li element

I've been unable to figure out how to manually fire DOM events. Here, for example, is my attempt to fire the "click" event for a li

Ext.DomQuery.select('#mapRoutesPanel ol li:nth-child('+(index+1)+')')[0].click();

It's working fine on google chrome, but when i build android native app of same application it gives me error

Uncaught TypeError: Object #<HTMLLIElement> has no method 'click'
like image 437
user1812198 Avatar asked Jun 07 '13 11:06

user1812198


1 Answers

Ext JS provides its methods for search elements in DOM tree.


Look Sencha Fiddle - its sencha touch app, i tested it on my android(opera) and iphone(safari) its work for me


Something like this:

var liElement = Ext.get('mapRoutesPanel').down('ol li:nth-child(' + (index + 1) + ')');
like image 167
Igor Semin Avatar answered Nov 17 '22 09:11

Igor Semin