This is a migrated thread and some comments may be shown as answers.

Grid can't work well with sortable?

2 Answers 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
hustcer
Top achievements
Rank 1
hustcer asked on 08 May 2014, 04:15 AM
Check out the example: http://jsbin.com/yagihuwe/1/edit

When the following code was commented:

$('#grid tbody').kendoSortable({
  axis:"y",
  change : function(e){
    var data = $('#grid').data('kendoGrid').dataItem(e.item);
  }
});

Change the selection of the grid row, then the name at grid bottom will be updated automatically, but when we enable the above code, and select different rows, the name just don't change. It seemed that the event was stopped by sortable widget. Any suggestions?

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 08 May 2014, 08:10 AM
Hello Hustcer,

You are correct - in your case the Sortable widget blocks event bubbling because it is initialized over Grid's tbody element. In order to avoid the issue you can initialize the Sortable over the Grid element and use filter to specify that only rows should be draggable.

$('#grid').kendoSortable({
  filter: "tbody > tr",
  axis:"y",
  change : function(e){
    var data = $('#grid').data('kendoGrid').dataItem(e.item);
  }
});

I hope this information will help.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
hustcer
Top achievements
Rank 1
answered on 08 May 2014, 08:16 AM
Great work! Thanks a lot!
Tags
Grid
Asked by
hustcer
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
hustcer
Top achievements
Rank 1
Share this question
or