angular dragdrop codef0rmer ng-repeat inserts empty object and removes elements - javascript

I'm using angular dragdrop codef0rmer library which gives cool features!
But however when I try to drag elements between two arrays (ng-repeat) I see many empty objects are created.
See this this plnkr code. When you try to move elements around (within and across the green drop area) you can see empty objects are created in both of the arrays. This is problem 1.
But I need way more dynamic (multiple ng-repeat within ng-repeat) like given in this plunkr.
Now the problem gets more complicated when we drap and drop within and around other containers (yellow).
it removes one element from each array.
creates empty objects like above problem.
I have tried all the ways around but no luck! Any helps, suggestions appreciated.

Related

d3 - nested selections/sub-item update issue

I'm getting used to d3, but seem to be having trouble with more advanced structures. I'm fairly sure there's some subtlety or concept I am not fully appreciating. I want to be able to mirror a changing hierarchical data structure with a changing hierarchical element structure.
My data structure is 3 groups, each with 3 items. Each group and item has a unique key, extracted using a key function in the data() call.
I build the structure, and I can remove a top-level item; .exit().remove() works just fine on that selection. BUT, modifying or removing any sub-item is simply not reflected in the generated element structure.
Full (non-)working jsFiddle here!: http://jsfiddle.net/eu95R/2/, and the all-important enticingly beautiful screenshot:
The problem is that your definition of groups is using svg.enter() and the subselection is made on groups. That is, you're not seeing a change because groups in this case is empty (no enter selection for the SVGs) and therefore there's no subselection.
To fix, simply do the subselection based on e.g. svg (there are a number of ways to fix this -- not saying that this is necessarily the best one). As you are appending the elements to a g within the SVG, the selector would be svg.selectAll("g").selectAll("text.item")....
Complete demo here.

Drag and drop divs using AngularJS

I'm creating a simple task manager where tasks are regrouped by steps. Therefore, many steps can have many tasks. Currently, I have my angularJS model mapped properly. What I want to do right now is to be able to reorder the divs representing the steps.
For example, if I have three steps named 1,3,2 I want to be able to drag the step 2 and move it above step 3 therefore putting them in the order 1,2,3. To do so, I would have to modify my angularJs model accordingly.
What I have currently, is that the ui is responding, I can see the step changing positions, but my the array containing all the steps stays in the same order... Is there a way to reorder this array or at least a way to get the new position of the step ?
http://plnkr.co/edit/bjsgQz?p=preview
You may want to consider using ui-sortable; I've used it on one of my own projects for allowing drag-and-drop reordering, and it's worked rather well. I should point out that it does have a dependency on JQuery/JQueryUI (for the sortable widget), but it was worth it for us.

ng-animate movement of a DOM element between multiple ng-repeat'ed arrays

Suppose:
there are multiple objects;
there are multiple arrays;
arrays can reference objects;
object can (and will) be referenced only once.
Simply put - object can "be" in one array at a time.
By "moving" particular object from one array to another, the object stays the same.
Problem is - AngularJS makes different DOM element for the same JS object in each of ng-repeat-ed arrays as the object "moves".
Question - given the situation, is it possible to clearly ng-animate this movement from one ng-repeat to another?
I have made a preview fiddle without this clear movement.
P.S. Someone with more reputation should add angularjs-ng-animate tag. :-)

jQuery isotope: Lock the position of specific items

I'm using jQuery Isotope to lay out a list of file entries contained in an <ol> element. I would like to keep Isotope from moving several items at the beginning of this list, such as an item indicating a parent folder. If I sort those elements using Isotope, the "parent" entry will be moved around which is very annoying.
Is there any way to tell Isotope not to change an item's position apart from "tweaking" the sort rules to assign a special sort index to it? This is the way it works now, but I am looking for a cleaner solution.
If needed I can provide a simplified jsFiddle test case.
This question was asked quite some time ago, and maybe back then the functionality wasn't available.
I just stumbled upon it and wanted to add that there's a "stamp" functionality, that tells isotope to layout the items around the "stamped" element.
http://isotope.metafizzy.co/methods.html#stamp
Stamps elements in the layout. Isotope will lay out item elements
around stamped elements.
// jQuery
$grid.isotope( 'stamp', elements )
// vanilla JS
iso.stamp( elements )

Javascript / jquery drag and drop between two tree view listing

I was looking around for drag and drop functionality of tree listing items between two tree views (not in single tree), I found couple of them which actually does in single tree itself, however unable to find which does between two trees.
I search for it, and unable to find any free script for this, could you please point me to the right one ?
Thanks
Here is a good example with drag'n drop between two treeviews :
http://demos.kendoui.com/treeview/dragdrop.html
From KendoUI ;)
Edit: another one, more complex but free : http://www.jstree.com/documentation/dnd

Categories