问题描述
我正在从jqGrid中拖动一行,并在jsTree(v.0.9.9a)中的一个节点上启动一个drop事件。
I am looking to drag a row from the jqGrid I have created and fire a drop event on a node in the jsTree (v.0.9.9a).
有没有这样做 - 仅使用jsTree的v.0.9.9a 。
Is there anyway to do this - using v.0.9.9a of the jsTree only.
问候。
推荐答案
经过多次辩论,我决定切换到jsTree版本1。
After much debate, i've decided to switch to jsTree version 1.
在jqGrid中添加事件
In jqGrid I added the event
afterInsertRow: function (rowid, rowdata, rowelem) {
$("#" + rowid).addClass('jstree-draggable');
},
然后我添加了jstree的dnd插件,它允许所有外部元素在jsTree中,使用事件drag_finish:function(data){}
将类jstree-draggable拖到树中。
I then added the dnd plugin for the jstree, which allows all external elements with the class "jstree-draggable" to be dragged into the tree with the event "drag_finish": function (data) {}
in the jsTree.
虽然jsTree版本1在使用版本1之前是一个痛苦的切换到它,它真的是更快,更整洁,更容易使用,一旦你得到它的悬念。我被告知,完整的文档将与版本1的最终版本一起发布。
While jsTree version 1 is a pain to switch to after using pre-Version 1 it really is a lot faster, neater and easier to use once you get the hang of it. I'm told that full documentation will be released with the version 1 final.
这篇关于从JQGrid拖到jsTree v.0.9.9a的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!