View Full Version : How do I reference an itemcls from my controller?

Thomas The Fourth
2 Mar 2012, 9:39 AM

I am trying to reference an itemcls by its selector name within my controller, but any event I attach to it fails to fire. Here's my code:

Creating the items like this in my view:

xtype : 'dataview',
scrollable : false,
id : 'filterlist',
hidden : 'true',
width : '250px',
style : ' height:200px; position:absolute; top:55px;color:white;font-size:25px;',
store : 'Filters',
itemCls : 'filteritem',
itemTpl : '<div>{filter}</div>'


Creating the references like this:

refs: { filteritem: { selector: 'filteritem'},filterlist: { selector: '#filterlist'} }

And I'm creating the listener like this:

filteritem : {
tap : this.filteritem_tap

Thanks in advance


2 Mar 2012, 11:26 AM
The selector and the control method both use ComponentQuery so you won't be able to use it to resolve an element.

Thomas The Fourth
2 Mar 2012, 1:50 PM
Got it. Thanks for clarifying. I will just do my logic in the view using itemtap.