Login Register

drag and drop

drag and drop auto arranging grid?

Hi,

I'm new to the UI side of AJAX, and I found the Dojo framework and it looks pretty promising! So I hope there is something in Dojo which has the functionality like this: http://tool-man.org/examples/sorting.html (scroll down to the section "Example: Sorting in two dimensions"). Thanks for your pointers!

Suan

dojo.dnd.Source object always accepts from self, regardless of accept parameter

I'm attempting to create a form where a user can drag items from [List A] into [List B], from [List B] into [List A] and re-order items in [List B]. However, I do not want the user to be able to re-order items in [List A]; effectively, I don't want [List A] to accept items from itself.

Creation of SOURCE when the it is Drop in the Target.

dojo.require("dojo.dnd.Source");
dojo.require("dojo.dnd.Container");
dojo.require("dijit.TitlePane");
dojo.require("dijit.form.Button");

function init() {
var shoppingCatalog = new dojo.dnd.Source("shelf");
var cart = new dojo.dnd.Target("shoppingCart", {accept: ["inStock"]});
var resetSelections = function(){
cart.selectNone();
shoppingCatalog.selectNone();
};
// highlight valid drop targets when a drag operation starts;
dojo.subscribe("/dnd/start", null, highlightTargets);

Abort/Cancel a drop automatically

I have an problem, where I need to programatically cancel a drag and drop (dnd) in progress. The reason for this is that when a div is dropped on the target, based on a series of algorithm checks (which can't be done earlier) the div will drop or it will fail.

I used to do

dojo.subscribe('/dnd/drop', function(source,nodes,iscopy){
    // do stuff
    var t = dojo.dnd.manager().target;
    t.containerState = '';
}

But since I've downloaded the latest version (which I needed for the grid updates) this no longer works.

Any help would be appreciated.

Drag and Drop from 'target' back to 'source'

Hello!

I've got a page that allows users to drag and drop from a div defined as a 'source' to a div defined as a 'target.' However, I need for the user to be able to drag items back to the 'source' div. Is this possible, or do I need to redesign how this works?

Thanks!

Spaz

Drag and Drop

Hi,

I'm new to the Dojo toolkit so please bear with me if any of my queries seem elementary. I was going through the step by step tutorial by Revin Guillen on Drag and Drop - http://www.sitepen.com/blog/2008/06/10/dojo-drag-and-drop-1/

I'm building a sample application based on that tutorial. So I have a simple list whose elements the user can reorder using drag and drop. This is the code I'm using.

@import url("http://o.aolcdn.com/dojo/1.1.1/dojo/resources/dojo.css");

Drag & Drop from dijit.Tree into dojo.dnd.Source (ordered list).

I have been playing around with Dojo's drag and drop functionalities lately to familiarize myself with the toolkit (v1.1.1).

One problem that I haven't been able to get just right is to make dragging items from a tree (copyOnly: true) into a dojo.dnd.Source which is an oredered list.
When I drop one of the tree items into the list, dojo appends a <div> element instead of creating a <li> element.

Drag n Drop elements with Tooltips on them

I'm busy making a drag'n'drop interface, from a source list of items to a destination list. On the items i also put a dijit.Tooltip. This works in the sourcelist, but once i dragged and dropped the item, the tooltip is gone. I'm using dojo 1.1.1. Any idea's?

Regards,

Edwin Eversdijk

  • My article (15 Sept 2008)
  • DND Accept All?

    I want to restrict then number of items in a dnd target to 8. To do this, I've added the line:

    if (reslength==8) target.accept="";

    This works fine, but how do I then allow items to be dropped again once reslength has been reduced. Basically, how to I set target.accept back to the default value? I've read that this is ["text"], but obviously this stops the target from accepting anything with a dndType other than "text". I want the target to accept ALL items when reslength < 8.

    Thanks in advance.

    Moving Tree nodes both horizontally and vertically

    I need a tree widget that lets me drag and drop nodes both within the same parent node (ordering), and to a different parent node (moving).

    Example:

    • Fruit
      • Apple
      • Orange
      • Tomato
    • Vegetable
      • Lettuce
      • Carrot
    Syndicate content