function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sandesh Vishwakarma 9Sandesh Vishwakarma 9 

Please help me out with this lightning component issue.

I have 2 slds box , In one I have 3 tect values now I want to drag 2 of them into second slds box and then have to save those two values into two different fields of the opportunity object.

[It is working fine till drag and drop onto another slds box now i want to save those 2 values into Opportunity object's 2 different fields.]

Here si my code 
Aura Component:-

<aura:component implements="force:appHostable">
    <aura:attribute name="startId" type="string"/>
    <aura:attribute name="parentId" type="string"/>
    
    <div class="slds-box" id="div1" ondrop="{!c.drop}" ondragover="{!c.allowDrop}">
        <h2 draggable="true" ondragstart="{!c.drag}" id="drag1" width="88" height="31"> Hiii</h2>
        <h2 draggable="true" ondragstart="{!c.drag}" id="drag2" width="88" height="31"> Hello</h2>
        <h2 draggable="true" ondragstart="{!c.drag}" id="drag3" width="88" height="31"> Hello There</h2>
        
    </div>
    
    
    
    <div class="slds-box" id="div3" ondrop="{!c.drop}" ondragover="{!c.allowDrop}"><span id="drag3"> </span></div>
    
</aura:component>
********************************************************************************************************
JS Controller :-

({
    allowDrop: function(cmp, event, helper){
        event.preventDefault();
    },
    drag: function(cmp, ev, helper){
          var parentId = document.getElementById(ev.target.id).parentElement.id;
       cmp.set("v.startId",ev.target.id);
       cmp.set("v.parentId",parentId);
    },
    drop: function(cmp, ev, helper){
        var drag = cmp.get("v.startId");
        var div = ev.target.id;
        alert(div);
        var fragment = document.createDocumentFragment();
        alert(fragment);
        fragment.appendChild(document.getElementById(drag));
        document.getElementById(div).appendChild(fragment);
        var c = document.getElementById(div).children;
        var x = document.getElementById('drag1').parentElement.id;
        var fragment = document.createDocumentFragment();
        fragment.appendChild(document.getElementById(c[0].id));
        document.getElementById(cmp.get("v.parentId")).appendChild(fragment);
    }
})