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

Event for dragging column and hide

3 Answers 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Markus asked on 08 Apr 2015, 07:12 AM

Hi

In my example - http://dojo.telerik.com/exaBa - I am looking for an event which lets me detect when a user drags the column but does not reorder it...

In other words: the user drags the column outside the grid - intention to delete (hide) that column.

 

I am aware that I can use the column menu, but that creates a button (that is not floating) and uses too much space (I have a lot of columns in my grid so I need all the space I can get)

 columnMenu: {
        sortable: false
   }

 

Many thanks

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 10 Apr 2015, 06:40 AM

Hello Markus,

I am afraid that such event is currently not available. The built-in feature for hiding columns is the column menu as you already noticed. You can submit this as a feature request on UserVoice, so that it is considered for implementation in a future release.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Vidya
Top achievements
Rank 1
answered on 25 Feb 2020, 11:44 AM

Hi,

Anybody found any workaround solution to achieve it?

0
Alex Hajigeorgieva
Telerik team
answered on 27 Feb 2020, 11:27 AM

Hi, Vidya,

The Kendo UI Grid and the Kendo UI Draggable widget that facilitates this functionality do not have such an event as part of their API.

However, you may get hold of the private property that holds the draggable instance and compare the id of the target and the currentTarget to check if the reorder occured. 

grid.one("dataBound", function(e){
    var grid = e.sender;
    grid._draggableInstance.bind("dragend", function(ev){
      var target = $(ev.target)
        if(target.attr("id")== ev.currentTarget.attr("id")){
          kendo.alert("No reorder occurred!");
        }  
    });
  });

Here is a runnable Dojo for your reference:

https://dojo.telerik.com/@bubblemaster/EdeHoWoS/2

The way to get hold of the draggable instance may differ dependent on the used grid features. In case you have any difficulties, provide the grid configuration you are working on.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Markus
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Vidya
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Share this question
or