1. #1
    Sencha User
    Join Date
    Nov 2007
    Posts
    5
    Vote Rating
    0
    b00 is on a distinguished road

      0  

    Question Updating TreePanel in dialog

    Updating TreePanel in dialog


    Hello,

    I have a TreePanel in dialog window, defined through xtype like this

    Code:
    	...
    	xtype: 'treepanel', 
    	autoScroll: true,
    	headers: [{
    		xtype: 'treeheader',
    		text: 'Col1',
    		flex: 1,
    		sortable: true,
    		dataIndex: 'col1'
    	},{
    		text: 'Col2',
    		flex: 2,
    		dataIndex: 'col2',
    		sortable: true
    	}],
    	store: new Ext.data.TreeStore({
    		autoLoad: false,
    		autoSync: false,
    		model: 'MyModel',
    		proxy: {
    			type: 'ajax',
    			url: 'data.json'
    		},
    		root: {
    			expanded: true
    		}
    	})
    The problem is that it requests 'data.json' immediately at page initialization instead of loading data when dialog window appear. How to define it to load data at dialog popup? I have tried 'autoLoad' and 'autoSync' options, but they didn't help.

    Thanks.

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    setup an afterrender event handler for the treepanel, that calls the store.load method.

Similar Threads

  1. Updating TreePanel or ListView
    By sjzaluk in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 23 Oct 2009, 6:00 AM
  2. Updating data in TreePanel.
    By Kudzu in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 7 Jan 2009, 9:28 AM
  3. Updating TreePanel after render
    By Voronchuk in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 24 Sep 2008, 3:20 AM
  4. Problems updating TreePanel using UpdateManager
    By daft in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 13 Mar 2007, 2:50 PM

Thread Participants: 1

Tags for this Thread