View Full Version : trying to get tpl divs

2 Mar 2012, 2:15 AM
I'm trying to get the divs made by the tpl so I can render to them, but it's unable to find them ... I think
or I'm calling it in the wrong way...

This is made in another class/element that I defined as the me variable a little while before

var someViewTest = Ext.create('Ext.view.View',
store: me.store,
itemSelector: 'div.'+ me.customClass,
tpl: [
'<tpl for=".">',
'<div class="'+ me.customClass+'" id="1">',

console.log('in afterrended');
var storeLength = this.store.data.length;

console.log(Ext.Element.get('#1'));//doesn't work rly doesn't
renderTo: Ext.get('1')


I've tried with 1 and #1 and .1
I tried calling another function in the class as well with the same stuff
I also tried Ext.get but the console always gives me null I tried getting a div from the index page that's there from start and that works as expected and shows helpful stuff in the console
I know it makes the elements because I can find them in the html when i load the page
is afterrender the wrong listener thing to do it in?

I'm hoping to make buttons with icons and text based on the data in a store for now I'm working with dummy data

2 Mar 2012, 2:21 AM
also right now there's only one line of data in the store so the id should be fully unique right now

2 Mar 2012, 6:12 AM
this is driving me absolutely crazy...

I just really want to generate buttons based of data in a store....

5 Mar 2012, 1:18 AM
I worked around this issue by not trying to make buttons.