1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    5
    Vote Rating
    0
    proyojana is on a distinguished road

      0  

    Default Problem with Tree Panel - Nodes disappear on closing Window

    Problem with Tree Panel - Nodes disappear on closing Window


    Hi,
    I've a window component with a Tree panel. The tree panel renders perfectly during the first time we open it. But once you close and re-open, the child nodes go missing.

    Any pointers on where things could be going wrong?

    Window Code below :
    Code:
    Ext.define('MyDesktop.view.MasterWindow', {
    	extend: 'Ext.ux.desktop.Module',
    	requires: [
    	'Ext.tab.*',
    	'Ext.window.*',
    	'Ext.tip.*',
    	'Ext.layout.container.Border',
    	'Ext.data.ArrayStore',
    	'Ext.util.Format',
    	'Ext.grid.*',
    	'Ext.grid.Panel',
    	'Ext.grid.RowNumberer',
    	'MyDesktop.store.MasterNavTree',
    	],
    	id:'master-win',
    	init : function() {
    		this.launcher = {
    			text: 'Masters Management',
    			iconCls:'icon-grid'
    		};
    	},
    	createWindow : function() {
    		var flag=0;
    		var egtab = Ext.create('MyDesktop.view.employeegroup.EmpGroupTabPanel');
    		var desigtab = Ext.create('MyDesktop.view.designation.DesigTabPanel');
    		var jobtab = Ext.create('MyDesktop.view.jobtitle.JobTabPanel');
    		var contentPanel = {
    			id: 'content-panel',
    			region: 'center', // this is what makes this panel into a region within the containing layout
    			layout: 'card',
    			margins: '2 5 5 0',
    			activeItem: 0,
    			border: false,
    			items: [egtab,desigtab,jobtab]
    		};
    
    
    		var desktop = this.app.getDesktop();
    		var masterwin = desktop.getWindow('master-win');
    		if(!masterwin) {
    			var masternavtree = Ext.create('MyDesktop.store.MasterNavTree');
    			var navs = Ext.create('Ext.tree.Panel', {
    		 		width: 200,
    				border: false,
    				store: masternavtree,
    				rootVisible: true,
    			   
    				});
    			masterwin = desktop.createWindow({
    				id: 'master-win',
    				title:'Master Management',
    				iconCls: 'icon-grid',
    				maximized: true,
    				animCollapse:false,
    				constrainHeader:true,
    				closable: true,
    				width: 600,
    				minWidth: 600,
    				height: 600,
    				layout: {
    					type: 'border',
    					padding: 5
    				},
    				items: [{
    					region: 'west',
    					title: 'Navigation',
    					split: true,
    					rootVisible: true,
    					autoScroll: true,
    					items: [navs]
    				},contentPanel]
    
    
    			});
    		}
    		return masterwin;
    	},
    });
    NavTree code
    Code:
    Ext.define('MyDesktop.store.MasterNavTree', {
        	extend:'Ext.data.TreeStore',
    		alias:'data.mnavtree',
    		root: {
            	expanded: true,
            	children: [
    				{ id:'employeegroup', text: "Employee Group",  leaf:true, loaded:true },
    { id:'designation', text: "Designation", leaf: true },
    { id:'jobtitle', text: "Job Title", leaf: true } ] } });

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi proyojana,

    Try refresh your tree panel view after TreePanel load like -
    Code:
    var navs = Ext.create('Ext.tree.Panel', {
                    width: 200,
                    border: false,
                    afterRender: function(){
                         this.getView().refresh();              // this refers your tree panel
                      }
                    store: masternavtree,
                    rootVisible: true
                });
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User
    Join Date
    Jan 2013
    Posts
    5
    Vote Rating
    0
    proyojana is on a distinguished road

      0  

    Default


    Hi sword-it,
    I'm afraid that is not working !

  4. #4
    Sencha User
    Join Date
    Jan 2013
    Posts
    5
    Vote Rating
    0
    proyojana is on a distinguished road

      0  

    Default Solved

    Solved


    Solved the problem by declaring the store variable within a custom definition for a tree panel called MasterNav and then creating a variable alone for this in the Window Component.
    Hope this helps for somebody else who might run into trouble.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi