I’m displaying a tree view using Connector and DataProcessor. I know I can set the leaf item images using:
insertNewNext(1,2,“New Node 2”,0,“txt.gif”,“opened.gif”,“closed.gif”);
But what I need help understanding is how to save the images assigned to the item in the database so that when the tree is reloaded the correct image is displayed. The image I’m speaking of is the little folder or book that currently is shown.
Any help appreciated.
Thank you,
John
Hi John,
DataProcessor sends “userdata” assigned to an item to the server. So, you can add the necessary images to userdata of the updated item:
tree.setUserData(itemId,“im0”,“txt.gif”);
tree.setUserData(itemId,“im1”,“opened.gif”);
tree.setUserData(itemId,“im2”,“closed.gif”);
Then I add a new entry using an insert the DataProcessor send this to the server:
Array
(
[tr_id] => 2_1382639422794
[tr_pid] => 2
[tr_order] => 1
[tr_text] => new item 123
[!nativeeditor_status] => inserted
)
I don’t see where it sends the type of image associated with this object.
Here’s what I’m trying to do:
dropbox.com/s/na0ryfhq6t2lyan/sample1.JPG
In this sample image I would like to have different leaf icons for each “new item 123” based on some criteria I set.
thanks.
OK, I’ve got the tree render question resolved by using beforeRender.