How to write a creator for dnd enabled dijit tree
I have a dijit tree that has dnd enabled via the dndController="dijit._tree.dndSource"
option. Currently, when drag 开发者_如何学Cis initiated, the avatar content seems to be right aligned. The avatar is automatically picking the image and text content of item that is being dragged but
I would like to have this information left aligned.
I believe that writing a custom creator function for the tree is the solution, but can find no examples of the same. Could someone point me to an example where the avatar for dijit tree is customized using a creator function?
Thanks,
FellOne solution to the problem, which may not work in all cases, is to use CSS classes to style the avatars. Dojo uses the HTML of the tree node in the avatar, or something like that, so if you write a CSS class for both the tree node and tree node avatar, you can have them display differently by using CSS similar to this:
.treeNodeItem {
text-align: right;
}
.dojoDndAvatarItem .treeNodeItem {
text-align: left;
}
I don't have my code in front of me, but I will try to remember to expand on this sometime later.
http://docs.dojocampus.org/dojo/dnd
精彩评论