- Home
- Forum
- ASP.NET MVC
- How to get target ID?
How to get target ID?
|
cardDrop: function (args) {
var obj = $("#Kanban").data("ejKanban");
if(!ej.isNullOrUndefined(obj.model.fields.swimlaneKey))
alert("Dropped Swimlane Id: " + args.draggedElement.parents(".e-columnrow").prev().attr("id"));
alert("Dropped Column mapping key: " + args.draggedElement.parent().attr("data-ej-mappingkey"));
}
|
Regards,
Arun P.
Thank you for helping me with this!
I'm using MVC and for some reason
args.draggedElement.parent().attr("data-ej-mappingkey")
returns as undefined.
I know the columns are getting the correct ID's because the cards are placed in the correct column.
But when I drag the card to a different column, args.draggedElement.parent() does exist as object, but the .attr("data-ej-mappingkey") part is undefined.
Again, if the key was not there, how come the card records were placed in the correct column?
I will attached the partial view...maybe you can see what I did wrong.
Thanks again!
Attachment: ForSyncFusionSupport_f00e9202.rar
I got it.
Instead of:
args.draggedElement.parent().attr("data-ej-mappingkey"));
I used:
args.draggedElement.parent().attr("ej-mappingkey"));
and that gets me the correct column id...why would the attribute be different??
Your code works fine in your example, and I put your code in the sample SyncFusion project and it also works...what is it about my project that would make the attribute different?
Thanks!!!
- 4 Replies
- 2 Participants
-
ST Sam Tran
- Sep 6, 2017 08:46 PM UTC
- Sep 11, 2017 11:53 AM UTC