Giter Site home page Giter Site logo

Comments (6)

ErwinSanquer avatar ErwinSanquer commented on May 21, 2024

Any update regarding this feature ?
Great job btw !

from ngx-dnd.

ErwinSanquer avatar ErwinSanquer commented on May 21, 2024

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.

Hypercubed avatar Hypercubed commented on May 21, 2024

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.

ErwinSanquer avatar ErwinSanquer commented on May 21, 2024

Maybe allowing to use .map() could be the solution if you want to avoid passing a function ?

from ngx-dnd.

Eve-Sama avatar Eve-Sama commented on May 21, 2024

Anything about this feature?

from ngx-dnd.

Delagen avatar Delagen commented on May 21, 2024

Any updates?

from ngx-dnd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.