PDA

View Full Version : LoadingText isn't displayed in DataView



prodigy7
6 Jul 2009, 11:12 PM
Hi there,

the following code works for me without any problems under ExtJS 2.x (I stripped the code on unimportant parts):
function loadGroupViewFinished(groupviewList)
{
....
}

function loadGroupViewFailed()
{
....
}

var store = new Ext.data.JsonStore({
url: 'desktop.php',
baseParams: {
content: 'group'
},
root: 'results',
fields: [
'iconText',
'iconDescr',
'iconImage',
'iconTag'
],
listeners: {
loadexception: loadGroupViewFailed,
load: loadGroupViewFinished
}
});

var tpl = new Ext.XTemplate(
'<tpl for=".">',
....
'</tpl>',
'<div class="x-clear"></div>'
);

winHandler = new Ext.Window({
id : 'group-' + iconTag,
width : 660,
height : 490,
title : iconText,
layout : 'border',
border : false,
autoScroll : true,
maximizable : false,
minimizable : false,
resizable : false,
items: [{
region: 'center',
autoScroll: true,
items: new Ext.DataView({
id : 'grouplist-' + iconTag,
cls : 'x-grouplist',
store : store,
tpl : tpl,
autoHeight : true,
autoWidth : true,
multiSelect : false,
border : false,
itemSelector : 'div.thumb-wrap',
emptyText : 'No images to display',
loadingText : 'Wird geladen'
})
},
new Ext.Panel({
height : 60,
region : 'south',
border : false,
baseCls : 'x-groupinfo',
items : [
new Ext.BoxComponent({
autoEl: {
tag: 'img',
src: './assets/images/modules/' + iconImage + '.png',
cls: 'x-groupinfo-logo'
}
}),
new Ext.BoxComponent({
autoEl: {
tag: 'div',
html: 'Information:',
cls: 'x-groupinfo-title'
}
}),
new Ext.BoxComponent({
autoEl: {
tag: 'span',
html: iconDescr,
cls: 'x-groupinfo-text'
}
})
]
})
]
});

winHandler.show(Ext.get('shortcut-' + iconTag));
store.load();I upgrade to 3.0 (replace only the 2.x files with 3.0) - anything works fine but the loading text isn't displayed. I also inspect the code during loading with firebug but I can't find and loading div which could contain the text. Internet Explorer 8 shows all right - Firefox 3.0.11 doesn't.
Bug?

Condor
6 Jul 2009, 11:17 PM
The loadingText div should be there!

But it could be zero height, because you created an unusual layout. I would have used:

{
region: 'center',
//autoScroll: true,
layout: 'fit',
items: new Ext.DataView({
...
//autoHeight: true,
//autoWidth: true,
autoScroll: true,
...
})
}

evant
6 Jul 2009, 11:18 PM
Can't get this to happen using a simplified test case:



Ext.onReady(function(){

var ds = new Ext.data.JsonStore({
fields: ['a'],
root: 'data',
url: 'data.asp'
});

var dv = new Ext.DataView({
renderTo: document.body,
width: 400,
height: 400,
tpl: '<tpl for="."><div class="foo">{a}</div></tpl>',
itemSelector: 'div.foo',
store: ds,
loadingText: 'Loading....'
});

ds.load();
});


data.asp contains an artificial delay so we can see the load text:



<%
For i = 0 To 100000000
Next
%>
{
data: [{
a: 'a'
},{
a: 'b'
},{
a: 'c'
}]
}

prodigy7
7 Jul 2009, 12:00 AM
Thanks for response! I modified my code in the way condor suggests but it doesn't change anything. Same effect: Internet Explorer shows the preloader, Firefox doesn't. I also inspect the html structure with ext 2.x and 3.0 and in Firefox, 2.x has an loading div container, in 3.0 not.
I try to build an example and post it then here.

evant
7 Jul 2009, 12:02 AM
There must be a bug in your layout somewhere, it definitely isn't an issue with the loadingText. Going to move this to help.

prodigy7
7 Jul 2009, 12:11 AM
Attached on this post I'll submit an sample which isn't working for me on firefox - but in Internet Explorer. So far I'm not yet an ExtJS expert so I'll not exclude that I do something wrong somewhere.