can't set icon with json and ajax loading

488 views
Skip to first unread message

marcello

unread,
Jun 22, 2010, 4:53:43 AM6/22/10
to jsTree
Hello,
I experienced a problem when trying to use an icon loading a tree data
via ajax and json format using pathname.
I followed the instructions described in online documentation on
http://www.jstree.com/documentation/json_data
I noticed that after being loaded, the html source of tree item
contains an empty style attribute; I also took a look at source code,
and saw that, just as documentation says, when a slash character is
encountered in icon key of json object this parameter is treated as a
pathname, building css code to set it as background image. But at that
point, for some reason, this operation fails.
I already checked that icon path in json object is correct.

Here is the json data that arrives to jstree

{"state": "closed", "data": {"icon": "/img/icons/tree/iconname",
"attr": {}, "title": "FACTORY"}, "attr": {"curnode": "example"}}


In the path for icon I also tried with dot notation, complete url,
everything, but result is the same.

If that's a bug, please let me know if it will fixed and
approximatively how long could it take.

Thanks

Regards

Marcello

vakata

unread,
Jun 23, 2010, 3:44:27 AM6/23/10
to jsTree
Hi,

This bug is already fixed - use the latest commit from the SVN.
Cheers,

Ivan

On Jun 22, 11:53 am, marcello <marca...@gmail.com> wrote:
> Hello,
> I experienced a problem when trying to use an icon loading a tree data
> via ajax and json format using pathname.
> I followed the instructions described in online documentation onhttp://www.jstree.com/documentation/json_data

marcello

unread,
Jun 23, 2010, 8:54:41 AM6/23/10
to jsTree
I downloaded jquery.jstree.js from repository and replaced the one I
had, but now nothing works and I have two javascript errors... do I
have to download other files?

(I'm using firefox 3.5)

Marcello

marcello

unread,
Jun 23, 2010, 9:08:33 AM6/23/10
to jsTree
I solved, ignore my previos message...
I saved file with "save link as", not a good idea :)

aj

unread,
Jun 25, 2010, 10:48:12 AM6/25/10
to jst...@googlegroups.com
did this work for you marcello?

It's not working for me, and as far as I know I am using the latest SVN.

Ivan, if I am using a theme e.g. the apple one, and then use the icon, what happens?
thanks

--
You received this message because you are subscribed to the Google Groups "jsTree" group.
To post to this group, send email to jst...@googlegroups.com.
To unsubscribe from this group, send email to jstree+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jstree?hl=en.


aj

unread,
Jun 25, 2010, 11:26:08 AM6/25/10
to jst...@googlegroups.com
take my question back, works - wasn't setting the icon INSIDE the data .
Reply all
Reply to author
Forward
0 new messages