I am using Dojo 1.5 and for some reasons dijit.Tree icons and +/- signs are
not visible on Windows7 (64bit) IE8 and Chrome.
If I click on the area, where the icon or signs should be, then the +/-
signs become visible, icon is still invisible.
(The same code/application works fine on Ubuntu 10.04 - Chromium browser)
The following code is used to draw tree:
<script type="text/javascript">
var rawdata = [
{
id: '1',
label: '1',
directory: true,
url: '1',
children:[
{
id: '1.1',
label: '1.1',
directory: true,
url: '1.1',
children:[
{
id: '1.1.1',
label: '1.1.1',
directory: true,
url: '1.1.1',
children:[
{
id: '1.1.1.1',
label: '1.1.1.1',
url: '1.1.1.1'
}
]
}
]
}
]
}
];
function onTreeClick(event,item){
location=item.item.url[0]
}
function GetIconClass(item, opened){
if ( item.root == true )
{
return ""
}
else
{
if ( item == "undefined" )
{
return ""
}
else
{
return item.directory ? (opened ? "dijitFolderOpened" :
"dijitFolderClosed") : "dijitLeaf";
}
}
}
function prepare() {
var store = new dojo.data.ItemFileReadStore({
data: {
identifier: 'id',
label: 'label',
items: rawdata
}
});
var treeModel = new dijit.tree.ForestStoreModel({store: store});
var treeControl = new dijit.Tree({
model: treeModel,
showRoot: false,
getIconClass: GetIconClass,
_createTreeNode: function(args) {
var tnode = new dijit._TreeNode(args);
tnode.labelNode.innerHTML = args.label;
return tnode;
}
},
"mytree");
dojo.connect(treeControl, "onClick", onTreeClick);
}
dojo.addOnLoad(prepare);
</script>
<div id="mytree"></div>
Settings getIconClass handler to a custom function or leaving the default
implementation doesn't help.
Any help is greatly appreciated.
Thank you.
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/dijit-Tree-icons-and-signed-are-not-visible-tp1298176p1298176.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://docs.dojocampus.org
Dojo-i...@mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
-Karl Tiedt
Unfortunately, I don't have any knowledge about JS. I tried to create a
small example, which reproduce the problem:
<script type="text/javascript">
var rawdata = [
{
id: '1',
label: '1',
directory: true,
url: '1',
children:[
{
id: '1.1',
label: '1.1',
directory: true,
url: '1.1',
}
]
}
];
function onTreeClick(event,item){
location=item.item.url[0]
}
function prepare() {
var store = new dojo.data.ItemFileReadStore({
data: {
identifier: 'id',
label: 'label',
items: rawdata
}
});
var treeModel = new dijit.tree.ForestStoreModel({store: store});
var treeControl = new dijit.Tree({
model: treeModel,
showRoot: false
},
"mytree");
dojo.connect(treeControl, "onClick", onTreeClick);
}
dojo.addOnLoad(prepare);
</script>
I found a few differences ( redefined getIconClass function) but this didn't
helped.
Do you see something I did wrong? If not, do you have an idea what I should
touch/configure?
Thanks for help.
P.S. I am using "Dojo Toolkit Release" and placed it as is ( extracted)
under the web server.
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/dijit-Tree-icons-and-signed-are-not-visible-tp1298176p1300467.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
<link rel="stylesheet" type="text/css"
href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css">
The example gets the stylesheet from dojo on the web. Alternatively, if you
have a local copy in a sub-folder "js", for example, you could use
<link rel="stylesheet" type="text/css"
href="js/dijit/themes/claro/claro.css">
--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/dijit-Tree-icons-and-signed-are-not-visible-tp1298176p1582860.html