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
VINODKUMAR REDDY KALUVAVINODKUMAR REDDY KALUVA 

How to move up and down rows in lightning component

How to move up and down rows in lightning component


User-added image
 
//Code From Controller

 Moveup : function(component, event, helper){
        console.log("enetered for moveup");
        //Execute the DeleteRowEvent Lightning Event and pass the deleted Row Index to Event attribute
        component.getEvent("Rowupdown").setParams({"indexVar" : component.get("v.rowIndex") }).fire();
    },
    
        Movedown : function(component, event, helper){
        console.log("enetered for movedown");
        //Execute the DeleteRowEvent Lightning Event and pass the deleted Row Index to Event attribute
        component.getEvent("Rowdown").setParams({"indexVar" : component.get("v.rowIndex") }).fire();
    }

<!--Code of Component --> 

  <td> 
                         <a onclick="{!c.Moveup}">
                        <lightning:icon  iconName="utility:chevronup" class="slds-icon slds-icon_small" size="small" alternativeText="chevronup"/>
                        <span class="slds-assistive-text">Up</span>
                    </a>
                    
                    </td>
                    <td> 
                        <a onclick="{!c.Movedown}">
                        <lightning:icon  iconName="utility:chevrondown" class="slds-icon slds-icon_small" size="small" alternativeText="chevrondown"/>
                        <span class="slds-assistive-text">Down</span>
                    </a>
                    </td>