开发者

Drag from JQGrid to jsTree v.0.9.9a

I am looking to drag a row from the jqGrid I have created and fire a drop event on a nod开发者_开发知识库e in the jsTree (v.0.9.9a).

Is there anyway to do this - using v.0.9.9a of the jsTree only.

Regards.


This is a really narrow question. It sounds like both controls use the jQuery UI draggable and droppable widgets, and that you have a preliminary approach. Why not try implementing your idea and see how well it works?

I would encourage you to post your code when you are done, or if you get stuck along the way...


After much debate, i've decided to switch to jsTree version 1.

In jqGrid I added the event

afterInsertRow: function (rowid, rowdata, rowelem) {
            $("#" + rowid).addClass('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.

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.


just:

$("#treeOptions").jstree({
   plugins: ["themes", "json_data", "dnd", "ui", "types"],
   ...
   dnd: { drag_target: ".jqgrow" }
   ...
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜