-
30 Jan 2009 5:30 AM #1
data view on desktop workig good 1 time after not working what haapend?
data view on desktop workig good 1 time after not working what haapend?
ferst time its working good but when i close it and open again its not shoing the data view
Code:var lookup = {}; var siteData = [ ['http://youtube.com','img24.jpg','youtube' ], ['http://youtube.com','desktop115411.jpg','youtube' ], ['http://youtube.com','desktop181.jpg','youtube' ], ['http://google.co.jp','desktop1111.png','google'], ['http://google.co.jp','desktop1111.png','google' ], ['http://yahoo.co.jp','648217_medium.jpg','yahoo'], ['http://extjs.com','http://capture.heartrails.com/small?http://extjs.com','extjs'], ['http://capture.heartrails.com','http://capture.heartrails.com/small?http://capture.heartrails.com','heartrails' ], ['http://yahoo.co.jp','648217_medium.jpg','yahoo'], ['http://extjs.com','http://capture.heartrails.com/small?http://extjs.com','extjs'], ['http://capture.heartrails.com','http://capture.heartrails.com/small?http://capture.heartrails.com','heartrails' ], ['http://youtube.com','../../resources/themes/xtheme-olive/xtheme-olive.png','youtube' ] ]; var store = new Ext.data.SimpleStore({ fields: [ { name: 'siteurl'}, { name: 'imgurl' }, { name: 'name' } ], data : siteData }); var formatData = function( data ){ lookup[ data.name ] = data; return data; }; var view = new Ext.DataView({ tpl: new Ext.XTemplate( '<tpl for=".">', '<div class="thumb-wrap" id="{name}">', '<div class="thumb"><img src="{imgurl}" title="{name}"></div>', '<span>{name}</span>', '</div>', '</tpl>' ), singleSelect: true, overClass:'x-view-over', itemSelector: 'div.thumb-wrap', store: store, listeners: { 'click':{ fn:function(){ var selNode = view.getSelectedNodes()[0]; var data = lookup[selNode.id]; location.href=data.siteurl; } } }, prepareData: formatData.createDelegate(this) }); MyDesktop.TeamspeakModule = Ext.extend(Ext.app.Module, { appType : 'Teamspeak', id : 'teamspeak-win', init : function(){ this.launcher = { text: 'data view', iconCls:'ts', handler : this.createWindow, scope: this } }, createWindow : function(){ var desktop = this.app.getDesktop(); var win = desktop.getWindow('teamspeak-win'); if(!win){ MyDesktop.getDim(); win = desktop.createWindow({ id: 'teamspeak-win', title:'data view', buttonAlign:'center', height:480, width:620,x:140,y:40, iconCls: 'ts', shim:false, animCollapse:false, layout: 'fit', border:false, constrainHeader:true, id: 'img-chooser-view', autoScroll: true, bodyStyle:"padding:5px", items:view, buttons: [{ text: 'close ', handler: function(){win.close();} }] }); } win.show(); } });
-
30 Jan 2009 6:01 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
your view is being destroyed it seems. you need to instantiate a new instance of view every time you re-open the window.
are you familiar with OO JS?
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
30 Jan 2009 6:12 AM #3
yes i need to refresh the page evry time how can i fix it?
-
30 Jan 2009 6:16 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
maybe - Build a factory method that creates a new view?!

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
31 Jan 2009 3:42 AM #5
-
31 Jan 2009 4:15 AM #6
I don't understand all of your code's context, but you could go something like this. Is that listener you have configured actually working?
Code:var view = new Ext.DataView({ tpl: new Ext.XTemplate( '<tpl for=".">', '<div class="thumb-wrap" id="{name}">', '<div class="thumb"><img src="{imgurl}" title="{name}"></div>', '<span>{name}</span>', '</div>', '</tpl>' ), singleSelect: true, overClass:'x-view-over', itemSelector: 'div.thumb-wrap', store: store, listeners: { 'click':{ fn:function(){ var selNode = view.getSelectedNodes()[0]; var data = lookup[selNode.id]; location.href=data.siteurl; } } }, prepareData: formatData.createDelegate(this) }); MyDesktop.TeamspeakModule = Ext.extend(Ext.app.Module, { appType : 'Teamspeak', id : 'teamspeak-win', init : function(){ this.launcher = { text: 'data view', iconCls:'ts', handler : this.createWindow, scope: this } }, createWindow : function(){ var desktop = this.app.getDesktop(); var win = desktop.getWindow('teamspeak-win'); if(!win){ MyDesktop.getDim(); var view= new Ext.DataView({ tpl: new Ext.XTemplate( '<tpl for=".">', '<div class="thumb-wrap" id="{name}">', '<div class="thumb"><img src="{imgurl}" title="{name}"></div>', '<span>{name}</span>', '</div>', '</tpl>' ), singleSelect: true, overClass:'x-view-over', itemSelector: 'div.thumb-wrap', store: store, listeners: { 'click':{ fn:function(){ var selNode = view.getSelectedNodes()[0]; var data = lookup[selNode.id]; location.href=data.siteurl; } } }, prepareData: formatData.createDelegate(this) }); win = desktop.createWindow({ id: 'teamspeak-win', title:'data view', buttonAlign:'center', height:480, width:620,x:140,y:40, iconCls: 'ts', shim:false, animCollapse:false, layout: 'fit', border:false, constrainHeader:true, id: 'img-chooser-view', autoScroll: true, bodyStyle:"padding:5px", items:view, buttons: [{ text: 'close ', handler: function(){win.close();} }] }); } win.show(); } });MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
31 Jan 2009 4:31 AM #7


Reply With Quote
