1. #1
    Ext JS Premium Member
    Join Date
    Dec 2007
    Location
    Z
    Posts
    119
    Vote Rating
    0
    Valentina is on a distinguished road

      0  

    Question Dataview

    Dataview


    Could somebody help me please,

    I've a tabpanel in which I would like to fill with a dataview.
    this is the store definition
    PHP Code:
        var stobl = new Ext.data.Store({
                  
    proxy: new Ext.data.HttpProxy({
                        
    url'/track/jsonobldata',
                        
    method'POST'
                  
    }),

                  
    reader: new Ext.data.JsonReader({
                        
    root'obldata'
                  
    }, [
                      {
    name'soobl'mapping'soobl'},
                    {
    name'soorx'mapping'soorx'},
                    {
    name'solx'mapping'solx'},
                    {
    name'sopdn'mapping'sopdn'},
                    {
    name'soodx'mapping'soodx'}    
                  ]),
                  
    remoteSorttrue  
            
    });
            
            
    stobl.load(); 
    My Jsonstring:

    PHP Code:
    {"obldata":[{"soobl":"NCGEW-0700162","soorx":"NAGOYA, AICHI","soolx":"NAGOYA, AICHI","sopdn":"HAMBURG","soodx":"HAMBURG"}]} 
    Here the XTemplate & Tabpanel and Dataviewdefinition:

    PHP Code:
            //OBL Information
            
    var oblinf = new Ext.XTemplate(       
                    
    '<div class="innerGrid">',
                    
    '<tpl for=".">',                
                        
    '<div style="width:300px">',
                        
    '<div id="float">OBL-Nr:</div><div id="float">{soobl}</div>',
                        
    '<div id="float">Port of Acceptance:</div><div id="float">SHANGHAI</div>',
                        
    '<div id="float">Port of Loading:</div><div id="float">SHANGHAI</div>',
                        
    '<div id="float">Port of Discharge:</div><div id="float">Bremerhaven</div>',
                        
    '<div id="float">Port of Destination:</div><div id="float">Bremerhaven</div>',
                        
    '<div>',
                       
    '</tpl>',
                       
    '<div class="x-clear"></div>'  
                
    );

     var 
    dvobl=new Ext.DataView({
                
    store:stobl,
                
    tploblinf,
                
    autoHeight:true,
                
    id:'dataview',
                
    multiSelecttrue,
                
    itemSelector:'div.innerGrid',
                
    emptyText'No images to display'
            
    });

        
    infowin = new Ext.Window({ 
                        
    layout:'form',
                           
    title:"Informations",
                        
    width:700,
                        
    autoHeight:true,
                        
    frame:true,
                        
    minimizablefalse,
                        
    maximizablefalse,
                        
    modaltrue,
                        
    plainfalse,
                        
    constraintrue,
                        
    items: [{
                              
    xtype "tabpanel",
                              
    items : [    {
                                  
    xtype "panel",
                                  
    title "TBL Item List",
                                  
    frame true,
                                  
    html  tblinf
                              
    },    
                              {
                                  
    xtype "panel",
                                  
    title "Container Load Plan",
                                  
    frame true,
                                  
    html  oblinf
                              
    },    
                              {
                                  
    xtype "panel",
                                  
    title "OBL Data",
                                  
    frame true,
                                  
    items : new Ext.DataView({
                                        
    store:stobl,
                                        
    tpl:oblinf,
                                        
    autoHeight:true,
                                        
    id:'dataview',
                                        
    multiSelecttrue,
                                        
    itemSelector:'div.innerGrid',
                                        
    emptyText'No images to display'
                                    
    })
                              }],
                              
    activeTab 0
                            
    }]
                }).
    show(); 
    I don't see anything in my tabpanel.

    Thank you

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,358
    Vote Rating
    127
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Use a layout of fit for your last panel which contains the DataView and drop the autoHeight configuration.

    Further troubleshooting make sure your Store has loaded the data. If you give it a storeId you should be able to do the following from the Firebug console...

    Code:
    Ext.StoreMgr.lookup('myStoreId').getRange();
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Ext JS Premium Member
    Join Date
    Dec 2007
    Location
    Z
    Posts
    119
    Vote Rating
    0
    Valentina is on a distinguished road

      0  

    Thumbs up


    Hi,

    Thank you for your quick reply, yes it was the layout.


Thread Participants: 1