Comments (6)
Any update regarding this feature ?
Great job btw !
from ngx-dnd.
I try to change the value in the event (drag) but when it's drop it still keep the old value.
I did find a way to change the dropped Item, but definitly not that nice implementation.
<div class="ngx-dnd-container" (drop)="builderDrop($event)" ngxDroppable="oneway-target" [removeOnSpill]="true" [model]="droppedItems">
<div class="ngx-dnd-item" ngxDraggable="['oneway-target']" *ngFor="let item of droppedItems" [model]="item">{{item.name_application_field}}</div>
</div>
builderDrop(e: any) {
if (e.value IS_YOUR_OLD_TYPE) {
const index = this.droppedItems.indexOf(e.value);
this.droppedItems.splice(index, 1, new ApplicationField(new Date().getTime(), e.value.field_type,
this.applicationId, e.value.field_type, {}));
}
}
The if in the builderDrop is mandatory if you want to be able to sort the element with the modified type, otherwise it create a new elem each time you drop.
Still should be nice to have some update feature or some explanation on how to achieve this properly.
from ngx-dnd.
Yes, the drop
event is how I am doing it now. I would like to allow a custom method for copy but have yet decided the best ergonomics for this. I've found that passing functions into components can be troublesome.
from ngx-dnd.
Maybe allowing to use .map() could be the solution if you want to avoid passing a function ?
from ngx-dnd.
Anything about this feature?
from ngx-dnd.
Any updates?
from ngx-dnd.
Related Issues (20)
- Transitive license is not valid since [email protected] has no license text HOT 1
- element should be orderable even if it has copy = true
- Previous and Current Container - Dropzone
- Documentation - Demo URL is 404
- Release with support for Angular 11 HOT 2
- multiple drop happening in dynamically created ngx-dnd-contianer (s) (used ngFor iteration)-stackblitz URL added
- Angular 12 Upgrade HOT 1
- Handle shadow dom HOT 1
- A11y Drag and Drop
- ngxDraggable onDrag event not calling
- ngxDragHandle not working with Angular 12 HOT 1
- Angular 12 Upgrade Release (PR already exists) HOT 5
- [Bug] Having a draggable element with `display: inline-block` inside a droppable container will disable dragging.
- Angular 13 Upgrade Release HOT 31
- [Help] Would you please update the builder demo by adding the restrictions (dropzone/s for ngx-dnd-container and ngx-dnd-item).
- [moves]="false"or [moves]="Any()" giving build time error if in tsconfig using ->"strictTemplates": true in angular 13. error "error TS2322: Type 'boolean' is not assignable to type '(model: any, source: any, handle: any, sibling: any) => boolean'."
- Version 6 is not compatible with Angular 10 and Ivy
- How to assign the dropzones to ngx-dnd-items when we are assigning model to the ngx-dnd-container
- Could we release an Ivy version to npm based on tag 9.1.0? HOT 6
- Is there any update for Angular16? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-dnd.