PDA

View Full Version : Dataview



Valentina
22 May 2009, 4:47 AM
Could somebody help me please,

I've a tabpanel in which I would like to fill with a dataview.
this is the store definition

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'}
]),
remoteSort: true
});

stobl.load();

My Jsonstring:


{"obldata":[{"soobl":"NCGEW-0700162","soorx":"NAGOYA, AICHI","soolx":"NAGOYA, AICHI","sopdn":"HAMBURG","soodx":"HAMBURG"}]}

Here the XTemplate & Tabpanel and Dataviewdefinition:


//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,
tpl: oblinf,
autoHeight:true,
id:'dataview',
multiSelect: true,
itemSelector:'div.innerGrid',
emptyText: 'No images to display'
});

infowin = new Ext.Window({
layout:'form',
title:"Informations",
width:700,
autoHeight:true,
frame:true,
minimizable: false,
maximizable: false,
modal: true,
plain: false,
constrain: true,
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',
multiSelect: true,
itemSelector:'div.innerGrid',
emptyText: 'No images to display'
})
}],
activeTab : 0
}]
}).show();



I don't see anything in my tabpanel.

Thank you

aconran
22 May 2009, 5:20 AM
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...



Ext.StoreMgr.lookup('myStoreId').getRange();

Valentina
22 May 2009, 5:38 AM
Hi,

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

:D