PDA

View Full Version : Treeview layout a bit off



hoeriksen
4 Aug 2010, 1:23 AM
Hi,

As part of the project I'm working on, I need to stick a treepanel inside an (ext)window. I used the example from the sencha pages to get started but it seems something has happened with the stylesheet when I transferred the code to my local test page. Since a picture tells a thousand words, I've included screenshot of my local tree. Does anyone know why the icons and the text for each node seem to be a bit off?

Below is the code for the treepanel and the window:

Ext.DomHelper.append(viewport, treepanel);

var tree = new Ext.tree.TreePanel({
renderTo:'treepanel',
useArrows:true,
hidden: true,
autoScroll:true,
animate:true,
//enableDD:true,
containerScroll: false,
rootVisible: false,
frame: false,
root: {
nodeType: 'async'
},

dataUrl: 'check-nodes.json',
listeners: {
'checkchange': function(node, checked){
if(checked){
node.getUI().addClass('complete');
}else{
node.getUI().removeClass('complete');
}
}
}
});

tree.getRootNode().expand(true);


var win;
var link = Ext.get('selectTag'); // This is just a small picture

link.on('click', function(){
if(!win){
win = new Ext.Window({
applyTo:'viewport',
layout:'fit',
width:500,
height:300,
title: 'Select tags',
closeAction:'hide',
plain: true,
buttons: [{
text:'Submit',
disabled:true
},{
text: 'Close',
handler: function(){
win.hide();
}
}],
listeners: {
beforeshow: function (w) {
tree.show();
}
},
items: tree
});
}
win.show(this);
});



file:///C:/Users/hoe/AppData/Local/Temp/moz-screenshot.png

Condor
4 Aug 2010, 1:26 AM
1. Do you have any custom css included?
2. Is your Ext.BLANK_IMAGE_URL set correctly?

hoeriksen
4 Aug 2010, 1:58 AM
Doh, it was a reference to a custom css that did it. I'm just (re)using an almost stripped html file while I'm testing but had forgotten to remove the reference to this one. Thanks a bunch!