
Originally Posted by
skirtle
Odd, it fixed it for me.
You'll need to provide a complete test case. The code you posted is missing key details like sample data and whatever this is. Please use [CODE] tags when posting code.
I was wondering already how you guys posted code
the data
Code:
Ext.define('App.store.DummyThumbStore', {
extend: 'Ext.data.Store',
model: 'App.model.Thumb',
data : [
{name: 'name', url: 'images/placeholder.png', id:'3' },
{name: 'name', url: 'images/placeholder.png', id:'4'},
{name: 'name', url: 'images/placeholder.png', id:'1'},
{name: 'somethumb', url: 'images/placeholder.png', id:'2'}
]
});
the model
Code:
Ext.define('App.model.Thumb', {
extend: 'Ext.data.Model',
fields: ['name', 'url', 'id']
});
the full view class
Code:
Ext.define('App.view.navigation.Thumbnails', {
extend: 'Ext.view.View',
alias: 'widget.thumbnails',
layout: 'fit',
//default thumb wrapping div name
customClass: 'defaultThumb',
store:'DummyThumbStore',
initComponent: function()
{
var me = this;
Ext.applyIf(me,
{
tpl: [
'<tpl for=".">',
'<div class= "'+ this.customClass+'" id="{id}">',
'<div class="thumb"><img src="{url}" ></div>',
'<span class="thumbtext">{name}</span></div>',
'</tpl>'
],
multiSelect: true,
trackOver: true,
overItemCls: 'x-item-over',
itemSelector: 'div.'+ this.customClass,
//need to move this to controller
listeners:
{
itemclick:this.test,
itemdblclick:this.testing
}
});
me.callParent(arguments);
},
test: function()
{
console.log('single click');
},
testing: function(view,record, item)
{
console.log('testing 123');
console.log(item.id);
}
});
one of the two panels it's in
Code:
Ext.define('App.view.navigation.Drawer',
{
cls:'drawer',
extend: 'Ext.panel.Panel',
alias: 'widget.drawer',
requires: ['Ext.panel.Panel'],
initComponent: function()
{
var me = this;
var tabsPanel = Ext.create('Ext.tab.Panel',
{//define the tabs/panels
bodyCls: 'panelBody',
items: [
{
xtype: 'panel',
title: 'test1',
items:[
{
xtype:'thumbnails',
customClass: 'drawerThumb'
}
]
},
{
xtype: 'panel',
title: 'test2'
},
{
xtype: 'panel',
title: 'test3'
}
]
});
Ext.applyIf(me,
{
items:[tabsPanel]
});
me.callParent();
return me;
}
});
the other view it's in
Code:
Ext.define('App.view.dock.Dock', {
extend: 'Ext.panel.Panel',
alias: 'widget.dock',
width: 100,
requires: ['Ext.panel.Panel'],
initComponent: function()
{
var me = this;
var thumbnails = Ext.create('App.view.navigation.Thumbnails',
{
customClass: 'dockThumb'
});
Ext.applyIf(me,
{
items:[thumbnails]
});
me.callParent(arguments);
}
});
could the testing data be causing this?
(I tried the case again without id's still no luck)