Old and new position of card...

what is the event that gives me the old and new position of the card after a move?

I cannot find the current position of the card within the column.

as in the xamarin version ...


thanks


6 Replies

GK Gunasekar Kuppusamy Syncfusion Team July 21, 2021 03:36 PM UTC

Hi Marco,


Greetings from Syncfusion support.


Currently, we are validating your reported query. We will update the further details within two business days on or before 23rd July

Regards
Gunasekar



VJ Vinitha Jeyakumar Syncfusion Team July 23, 2021 03:02 PM UTC

Hi Marco, 
 
 
Good day to you 
 
 
We have validated your query “Old and new position of card 
 
You can achieve your requirement using “dragStop” event in Kanban. You can find the current position of the card within the column using “dropIndex” property of DragEventArgs. Please check the code snippet for your reference. 
 
Code snippet: 
app.component.html 
<ejs-kanban id="Kanban" dragStop="OnDragStop"></ejs-kanban> 
app.component.ts 
var position; 
    function OnDragStop(args) { 
        this.position = args.dropIndex; 
        console.log(this.position); 
         
    } 
 
 
Please check the above sample and code snippet, and let us know if it satisfies your requirement. 
 
Regards, 
Vinitha 



MS Marco Salvatori July 23, 2021 07:50 PM UTC

very good.

is there any way to know the starting index? where can i find information on these properties?

thank you



VJ Vinitha Jeyakumar Syncfusion Team July 26, 2021 01:05 PM UTC

Hi Marco, 
 
 
Good day to you 
 
 
We have validated your query “is there any way to know the starting index? where can i find information on these properties?”. 
 
You can achieve your requirement using “dragStart” event of Kanban control. In which we can get the starting position of the card using “indexOf“ method. Please check the below code snippets for your reference. 
 
Code snippet:  
<ejs-kanban id="Kanban" keyField="Status" created="onCreate" dragStart="OnDragStart"> 
<script> 
    var initial; 
    var cards; 
    var id; 
    var kanbanObj; 
    function onCreate() { 
        kanbanObj = this; 
    } 
    function OnDragStart(args) { 
        this.initial = args.data[0].Id; 
        this.cards = kanbanObj.getColumnData(args.data[0].Status); 
        this.id = this.cards.indexOf(args.data[0]); 
        console.log(this.id); 
    } 
</script> 
 
 
Please check the above code snippet and sample and let us know if it satisfies your requirement. 
 
Regards, 
Vinitha 
 
 



MS Marco Salvatori July 28, 2021 08:57 AM UTC

good...very good...

thanks



RK Revanth Krishnan Syncfusion Team July 29, 2021 11:49 AM UTC

Hi Marco, 
 
Thanks for the update. 
We are glad that the provided solution satisfied your requirement. Please let us know if you need any further assistance. 
 
Regards, 
Revanth 


Loader.
Up arrow icon