1. #21
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    5
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    I typically don't just post the solution, I think it's your job to create and debug your code.

    If I were you I would make a simple proof of concept.
    1. create static data variable
    2. create form panel with say 2 fields
    3. create grid with 2 fields.
    4. load the form panel and grid.

    Once you have that, then modify your layout, to be a tabpanel with tabs for Form and Grid.

    Once you have that modify tabPanel to be in Window.

    Once you have that modify to use a button or icon or whatever to dynamically load the static data.

    Then finally modify to use XML.

    If you go through these steps you should see where your problem is...I think.

  2. #22
    Ext User r2k's Avatar
    Join Date
    Aug 2007
    Posts
    67
    Vote Rating
    0
    r2k is on a distinguished road

      0  

    Default


    ok got it ...
    UPDATE: Solved later update the details thank you for all
    [extjs 2.2]
    [Browsers: IE(6/7/8), FF (3.0.8), chrome 2.0]

  3. #23
    Ext User r2k's Avatar
    Join Date
    Aug 2007
    Posts
    67
    Vote Rating
    0
    r2k is on a distinguished road

      0  

    Thumbs up juicy details

    juicy details




    OK, the solution wasn't any of my previous theories .....
    was that the data i was incoming in the second Datastore was in the incorrect format...

    i inserted a Field.data in LoadData() method.
    well the LoadData() method was waiting to recieve a simple Multidimensional Array (oversight it ... too much cafeine )

    by the way i'm changed my second datastore for a SimpleStore to symplify my declaration

    This is my final code
    Code:
    {
    		title	: '...',
    		xtype	: 'grid',
    		id		: 'grdXXXX',
    		store	: new Ext.data.SimpleStore({
    				data		: [['Dummy Prop','Dummy Val']],
    				fields 		: [{name: 'tname', mapping: 0, type: 'string'},
    							   {name: 'tvalue', mapping: 1, type: 'string'}]
    				}),
    		columns		: [
    			{header	: "Property", width: 200, sortable: true, dataIndex: 'tname'},
    			{header	: "Value", width: 120, sortable: false, dataIndex: 'tvalue'}
    		],
    		viewConfig	: {
    			forceFit	: true,
    			emptyText	: '...'
    		}
    	}]
    }
    and here comes the magic
    Code:
    store	: new Ext.data.Store({
    	proxy		: new Ext.data.HttpProxy({url : 'detObject.asp'}),
    	id			: 'tname',
    	reader		: new Ext.data.XmlReader({
    		record		: 'data'
    		},
    		[{name: 'name', mapping: '@tname'},
    		{name: 'value', mapping: '@tvalue'}]
    	),
    	listeners	:{
    		'load'	: function(	oDts, oRecs, oOpts){
    			var cont,cont2;
    			var oFld = new Array();
    			cont2=0;
    			Ext.getCmp('grdXXXX').store.removeAll(); //legacy code ... maybe rendundant
    			for(cont=0;cont < oRecs.length;cont++ ){
    				if(oRecs[cont].get('nombre') == 'XXXX'){
    					Ext.getCmp('tpGral').form.findField("txtXXXX").setValue(oRecs[cont].get('tvalue'));
    					continue;
    				}
    				else{
    					oFld[cont2]= [oRecs[cont].get('tname'),oRecs[cont].get('tvalue')];
    					cont2++;
    				}
    			}
    			Ext.getCmp('grdXXXX').store.loadData(oFld,false);
    			oFld=null;
    		}
    	}
    }),
    in short Words it's offcially SOLVED
    [extjs 2.2]
    [Browsers: IE(6/7/8), FF (3.0.8), chrome 2.0]