开发者

Making an Asp.Net treeview draggable: how to set a css class for Leaf Nodes only?

开发者 https://www.devze.com 2023-01-26 10:50 出处:网络
I have an Asp.net treeview and am building the nodes programmatorically in my codebehind. Now, this treeview is 3 levels deep, being ROOT -> CATEGORY -> Tasks belonging to this category.I would now l

I have an Asp.net treeview and am building the nodes programmatorically in my codebehind.

Now, this treeview is 3 levels deep, being ROOT -> CATEGORY -> Tasks belonging to this category. I would now like to allow the user to drag these leaf tasks to another table, but only the leafs should be draggable (I'm using the Jquery draggable plugin for this, s开发者_JAVA百科o I just need to set the css class).

Any idea how I can set the CSS class for the leaf node only (codebehind or js)? I've tried something like:

<asp:treeview id="treeviewTasks" runat="server"  leafnodestyle="draggable"  />

but that doesn't seem to do the trick :(

thanks

Sam


Turned out I was almost there, but not quite. The correct syntax is:

<asp:treeview id="treeviewTasks" runat="server" leafnodestyle-cssclass="draggable hand"/>

RTM I guess :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号