使 Asp.Net 树视图可拖动:如何仅为叶节点设置 css 类?
我有一个 Asp.net 树视图,并且正在我的代码隐藏中以编程方式构建节点。
现在,该树视图的深度为 3 层,即 ROOT ->类别 ->属于此类别的任务。我现在想允许用户将这些叶子任务拖动到另一个表,但只有叶子应该是可拖动的(我为此使用 Jquery Draggable 插件,所以我只需要设置 css 类)。
知道如何仅为叶节点设置 CSS 类(代码隐藏或 js)吗?我尝试过类似的方法:
<asp:treeview id="treeviewTasks" runat="server" leafnodestyle="draggable" />
但这似乎不起作用:(
谢谢
山姆
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, so 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
结果我就快到了,但还没有完全到。正确的语法是:
RTM 我猜:)
Turned out I was almost there, but not quite. The correct syntax is:
RTM I guess :)