
I can't seem to handle a click event inside of a sortable object. Is this possible? My code looks like:
<kendo-sortable [kendoSortableBinding]="selectedColumns" [animation]='true' (dragEnd)='onDragEnd($event)' >
<ng-template let-column="item">
<div class="selected-column">
<span draggable="true" class="k-icon k-i-handler-drag"></span>
<span style="flex-grow: 1">{{ column.displayName }}</span>
<span (click)="removeSelectedColumn(column)" class="k-icon k-i-close" style="cursor: pointer;"></span>
</div>
</ng-template>
</kendo-sortable>
The remove span click event never fires. What's the workaround?
10 Answers, 1 is accepted
The click handler seems to work in this example. Am I missing something?
Regards,
Daniel
Progress Telerik


Hi,
we have the same problem: a clickhandler is never called, but instead always the dragEnd handler.
This is the difference between the code of the thread starter and the code provided in the stackblitz example.
How can we make the clickhandler working inside a sortable with a dragEnd handler defined?
The click handler seems to be called with dragEnd handler attached - updated example. Am I missing something?
Regards,
Daniel
Progress Telerik

Hi,
thanks for the update.
As we can see now, the dragEnd handler is called before the click handler (same in our impl.) In our impl. we do a server call when the element was dropped.
So we just check in the dragEnd handler
if (dragEndEvent.index !== dragEndEvent.oldIndex) {
and can fullfil the requirements. But this a workaround. Is there any way to avoid the call to the dragEnd handler on an onClick event?
Kind regards
Both issues seem like a bug. We will look into it and I will follow up here once there is more information or a fix.
Regards,
Daniel
Progress Telerik
Please try with the latest dev version - updated example. Both issues should be fixed.
Regards,
Daniel
Progress Telerik

Hi,
thanks, i can confirm that in the current dev-version the ondragend handler is not called anymore on the onclick event.
When can we expect a new release?
Kind regards
Hello Christian,
We just released the 3.0.1 version of the Sortable package that contains the discussed fix. It should be already available via NPM.
Regards,
Dimiter Topalov
Progress Telerik